implemented TcpServer class