diff options
author | Martin Lucina <mato@kotelna.sk> | 2011-10-03 17:09:06 +0200 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:54:33 +0100 |
commit | c3363afa881b46f3df8a6b72ed15cfbac18f4713 (patch) | |
tree | 832e8075a038b49f81e8a7635344f1647007fd15 /src/tcp_socket.cpp | |
parent | 88f712b4a31c95caef4f34c4ec65793c392314a6 (diff) | |
parent | 978e33ba253a997b41b331b449b474a5cee7bccc (diff) |
Imported Debian patch 2.1.10-1debian/2.1.10-1
Diffstat (limited to 'src/tcp_socket.cpp')
-rw-r--r-- | src/tcp_socket.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tcp_socket.cpp b/src/tcp_socket.cpp index e7a69e4..07159d8 100644 --- a/src/tcp_socket.cpp +++ b/src/tcp_socket.cpp @@ -79,7 +79,7 @@ int zmq::tcp_socket_t::write (const void *data, int size) // we'll get an error (this may happen during the speculative write). if (nbytes == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK) return 0; - + // Signalise peer failure. if (nbytes == -1 && ( WSAGetLastError () == WSAENETDOWN || @@ -119,7 +119,7 @@ int zmq::tcp_socket_t::read (void *data, int size) // Orderly shutdown by the other peer. if (nbytes == 0) - return -1; + return -1; return (size_t) nbytes; } @@ -200,6 +200,9 @@ int zmq::tcp_socket_t::write (const void *data, int size) if (nbytes == -1 && (errno == ECONNRESET || errno == EPIPE)) return -1; + if (nbytes == 1) + fprintf (stderr, "E: unhandled error on send: %d/%s\n", + errno, strerror (errno)); errno_assert (nbytes != -1); return (size_t) nbytes; } @@ -220,6 +223,9 @@ int zmq::tcp_socket_t::read (void *data, int size) errno == ETIMEDOUT || errno == EHOSTUNREACH)) return -1; + if (nbytes == 1) + fprintf (stderr, "E: unhandled error on recv: %d/%s\n", + errno, strerror (errno)); errno_assert (nbytes != -1); // Orderly shutdown by the other peer. |