if (r == -1 /* or r < 0 */
&& errno == EWOULDBLOCK)
{...}
更优良的风格:
r = recv(...);
if (r == SOCKET_ERROR
&& WSAGetLastError == WSAEWOULDBLOCK)