diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-10 16:59:22 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-10 16:59:22 +0200 |
commit | f824b8a067c60b32260c56020742d6428ed3bb98 (patch) | |
tree | 6674e98d74a16becfd8c8998b28e0d4930676eff | |
parent | f674c9269e04546da22e45ef6fff9303441680ea (diff) |
classify error from async connect as network related or 0MQ bugs
-rw-r--r-- | src/tcp_connecter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index 7058648..80aeea8 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -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; } |