读书人

socket通信方面的一点有关问题

发布时间: 2012-05-28 17:59:54 作者: rapoo

socket通信方面的一点问题
我编写了一个windows的socket通信程序接口。在与其他系统连接测试时发现这么个问题:
程序recv返回-1,而errno=0,这是为什么呢

[解决办法]
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.


[解决办法]
赵老师给你解答了

读书人网 >C++

热点推荐