The following simple Server opens a port on 2000 and waits for incoming connections. Each connection is answered with the same line as was written (echoed).
If you want to test the server, use
telnet localhost 2000
本文介绍了一个简单的回显服务器的实现方法,该服务器监听2000端口并响应所有传入连接。对于每个连接,服务器接收客户端发送的消息并将其原样返回(回显)。示例代码使用了Socket编程,并通过C++实现。
915

被折叠的 条评论
为什么被折叠?



