mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-16 07:23:46 +02:00
classify error from async connect as network related or 0MQ bugs
This commit is contained in:
@@ -106,6 +106,11 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
||||
int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char*) &err, &len);
|
||||
zmq_assert (rc == 0);
|
||||
if (err != 0) {
|
||||
|
||||
// Assert that the error was caused by the networking problems
|
||||
// rather than 0MQ bug.
|
||||
zmq_assert (err == ECONNREFUSED);
|
||||
|
||||
errno = err;
|
||||
return retired_fd;
|
||||
}
|
||||
@@ -217,6 +222,11 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
||||
if (rc == -1)
|
||||
err = errno;
|
||||
if (err != 0) {
|
||||
|
||||
// Assert that the error was caused by the networking problems
|
||||
// rather than 0MQ bug.
|
||||
zmq_assert (err == ECONNREFUSED);
|
||||
|
||||
errno = err;
|
||||
return retired_fd;
|
||||
}
|
||||
|
Reference in New Issue
Block a user