mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-25 07:41:10 +01:00
Fix for LIBZMQ-526
This commit is contained in:
parent
0880d5b8ed
commit
f4dbccd4fb
@ -251,7 +251,7 @@ int zmq::tcp_connecter_t::open ()
|
|||||||
|
|
||||||
zmq::fd_t zmq::tcp_connecter_t::connect ()
|
zmq::fd_t zmq::tcp_connecter_t::connect ()
|
||||||
{
|
{
|
||||||
// Async connect have finished. Check whether an error occured.
|
// Async connect has finished. Check whether an error occurred
|
||||||
int err = 0;
|
int err = 0;
|
||||||
#if defined ZMQ_HAVE_HPUX
|
#if defined ZMQ_HAVE_HPUX
|
||||||
int len = sizeof (err);
|
int len = sizeof (err);
|
||||||
@ -266,9 +266,13 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
|||||||
#ifdef ZMQ_HAVE_WINDOWS
|
#ifdef ZMQ_HAVE_WINDOWS
|
||||||
zmq_assert (rc == 0);
|
zmq_assert (rc == 0);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
if (err == WSAECONNREFUSED || err == WSAETIMEDOUT ||
|
if (err == WSAECONNREFUSED ||
|
||||||
err == WSAECONNABORTED || err == WSAEHOSTUNREACH ||
|
err == WSAETIMEDOUT ||
|
||||||
err == WSAENETUNREACH || err == WSAENETDOWN)
|
err == WSAECONNABORTED ||
|
||||||
|
err == WSAEHOSTUNREACH ||
|
||||||
|
err == WSAENETUNREACH ||
|
||||||
|
err == WSAENETDOWN ||
|
||||||
|
err == WSAEINVAL)
|
||||||
return retired_fd;
|
return retired_fd;
|
||||||
wsa_assert_no (err);
|
wsa_assert_no (err);
|
||||||
}
|
}
|
||||||
@ -280,9 +284,14 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
|||||||
err = errno;
|
err = errno;
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
errno = err;
|
errno = err;
|
||||||
errno_assert (errno == ECONNREFUSED || errno == ECONNRESET ||
|
errno_assert (
|
||||||
errno == ETIMEDOUT || errno == EHOSTUNREACH ||
|
errno == ECONNREFUSED ||
|
||||||
errno == ENETUNREACH || errno == ENETDOWN);
|
errno == ECONNRESET ||
|
||||||
|
errno == ETIMEDOUT ||
|
||||||
|
errno == EHOSTUNREACH ||
|
||||||
|
errno == ENETUNREACH ||
|
||||||
|
errno == ENETDOWN ||
|
||||||
|
errno == EINVAL)
|
||||||
return retired_fd;
|
return retired_fd;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user