一般有三种情况:
1,服务端不存在;
2,连接不存在;
3,通过WSAGetLastError获取到错误。
以下是MSDN的解释。
WSAEWOULDBLOCK
(10035)
-
Resource temporarily unavailable.
- This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
- 即在非阻塞模式时,connect不会马上返回,它需要时间来确定。因此他会返回这个值.此时它是正常的.