mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-15 02:07:59 +08:00
more errors from send & recv handled decently on windows
This commit is contained in:
parent
98b8e9b54d
commit
bce2e60bbb
@ -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)
|
|||||||
|
|
||||||
// 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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user