Commit bce2e60b authored by Martin Sustrik's avatar Martin Sustrik

more errors from send & recv handled decently on windows

parent 98b8e9b5
...@@ -65,7 +65,13 @@ int zmq::tcp_socket_t::write (const void *data, int size) ...@@ -65,7 +65,13 @@ int zmq::tcp_socket_t::write (const void *data, int size)
return 0; return 0;
// Signalise peer failure. // Signalise peer failure.
if (nbytes == SOCKET_ERROR && WSAGetLastError () == WSAECONNRESET) if (nbytes == -1 && (
WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAEHOSTUNREACH ||
WSAGetLastError () == WSAECONNABORTED ||
WSAGetLastError () == WSAETIMEDOUT ||
WSAGetLastError () == WSAECONNRESET))
return -1; return -1;
wsa_assert (nbytes != SOCKET_ERROR); wsa_assert (nbytes != SOCKET_ERROR);
...@@ -84,6 +90,10 @@ int zmq::tcp_socket_t::read (void *data, int size) ...@@ -84,6 +90,10 @@ int zmq::tcp_socket_t::read (void *data, int size)
// Connection failure. // Connection failure.
if (nbytes == -1 && ( if (nbytes == -1 && (
WSAGetLastError () == WSAENETDOWN ||
WSAGetLastError () == WSAENETRESET ||
WSAGetLastError () == WSAECONNABORTED ||
WSAGetLastError () == WSAETIMEDOUT ||
WSAGetLastError () == WSAECONNRESET || WSAGetLastError () == WSAECONNRESET ||
WSAGetLastError () == WSAECONNREFUSED || WSAGetLastError () == WSAECONNREFUSED ||
WSAGetLastError () == WSAENOTCONN)) WSAGetLastError () == WSAENOTCONN))
......
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