Commit d0b9005e authored by Martin Hurton's avatar Martin Hurton

Don't assume SOCKET_ERROR is -1 on Windows

parent ac53f1a7
......@@ -292,7 +292,7 @@ int zmq::stream_engine_t::write (const void *data_, size_t size_)
return 0;
// Signalise peer failure.
if (nbytes == -1 && (
if (nbytes == SOCKET_ERROR && (
WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAEHOSTUNREACH ||
......@@ -338,7 +338,7 @@ int zmq::stream_engine_t::read (void *data_, size_t size_)
return 0;
// Connection failure.
if (nbytes == -1 && (
if (nbytes == SOCKET_ERROR && (
WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAECONNABORTED ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment