[Quote=引用 5 楼 dijkstar 的回复:]
楼主不必担心此问题,当服务器一端关闭时,客户端的socket由阻塞立即返回错误,检测这个错误即可退出
[/Quote]
Return Values
If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.