From 5b9de45a89b46f9b2a07236efcee7182ff1c2dee Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Mon, 29 Oct 2012 10:09:00 +0100 Subject: [PATCH] Resolve LIBZMQ-447 --- src/socket_base.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 10f38d93..54036eca 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -677,11 +677,6 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_) return -1; } - // Get the message. - int rc = xrecv (msg_, flags_); - if (unlikely (rc != 0 && errno != EAGAIN)) - return -1; - // Once every inbound_poll_rate messages check for signals and process // incoming commands. This happens only if we are not polling altogether // because there are messages available all the time. If poll occurs, @@ -696,6 +691,11 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_) ticks = 0; } + // Get the message. + int rc = xrecv (msg_, flags_); + if (unlikely (rc != 0 && errno != EAGAIN)) + return -1; + // If we have the message, return immediately. if (rc == 0) { extract_flags (msg_);