Don't assume SOCKET_ERROR is -1 on Windows

This commit is contained in:
Martin Hurton
2012-05-27 23:26:14 +02:00
parent ac53f1a728
commit d0b9005ef0

View File

@@ -292,7 +292,7 @@ int zmq::stream_engine_t::write (const void *data_, size_t size_)
return 0; return 0;
// Signalise peer failure. // Signalise peer failure.
if (nbytes == -1 && ( if (nbytes == SOCKET_ERROR && (
WSAGetLastError () == WSAENETDOWN || WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET || WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAEHOSTUNREACH || WSAGetLastError () == WSAEHOSTUNREACH ||
@@ -338,7 +338,7 @@ int zmq::stream_engine_t::read (void *data_, size_t size_)
return 0; return 0;
// Connection failure. // Connection failure.
if (nbytes == -1 && ( if (nbytes == SOCKET_ERROR && (
WSAGetLastError () == WSAENETDOWN || WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET || WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAECONNABORTED || WSAGetLastError () == WSAECONNABORTED ||