diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/socket_base.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index a10ed0e..bfaacb7 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -519,13 +519,15 @@ int zmq::socket_base_t::recv (::zmq_msg_t *msg_, int flags_) // In blocking scenario, commands are processed over and over again until // we are able to fetch a message. + bool block = (ticks != 0); while (rc != 0) { if (errno != EAGAIN) return -1; - if (unlikely (process_commands (true, false) != 0)) + if (unlikely (process_commands (block, false) != 0)) return -1; rc = xrecv (msg_, flags_); ticks = 0; + block = true; } rcvmore = msg_->flags & ZMQ_MSG_MORE; |