Write TcpServer, use it in TestTcpServer