diff options
author | Martin Lucina <martin@lucina.net> | 2012-05-20 11:24:59 +0200 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-05-20 11:24:59 +0200 |
commit | 56619463ac26dc6c3e576d2fbf6b544eebeb5148 (patch) | |
tree | f23e0eed3e7d347e71e5a6b4f983692bdec2078d /src/socket_base.cpp | |
parent | 4016b657973bba87caf75168ba70aaa85d556487 (diff) |
Imported Upstream version 2.2.0upstream
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r-- | src/socket_base.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 335a858..cd4152c 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -510,13 +510,13 @@ int zmq::socket_base_t::send (::zmq_msg_t *msg_, int flags_) // In case of non-blocking send we'll simply propagate // the error - including EAGAIN - upwards. - if (flags_ & ZMQ_NOBLOCK) + if (flags_ & ZMQ_NOBLOCK || options.sndtimeo == 0) return -1; // Compute the time when the timeout should occur. // If the timeout is infite, don't care. clock_t clock ; - int timeout = -1; + int timeout = options.sndtimeo; uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout); // Oops, we couldn't send the message. Wait for the next @@ -589,7 +589,7 @@ int zmq::socket_base_t::recv (::zmq_msg_t *msg_, int flags_) // For non-blocking recv, commands are processed in case there's an // activate_reader command already waiting int a command pipe. // If it's not, return EAGAIN. - if (flags_ & ZMQ_NOBLOCK) { + if (flags_ & ZMQ_NOBLOCK || options.rcvtimeo == 0) { if (errno != EAGAIN) return -1; if (unlikely (process_commands (0, false) != 0)) @@ -608,7 +608,7 @@ int zmq::socket_base_t::recv (::zmq_msg_t *msg_, int flags_) // Compute the time when the timeout should occur. // If the timeout is infite, don't care. clock_t clock ; - int timeout = -1; + int timeout = options.rcvtimeo; uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout); // In blocking scenario, commands are processed over and over again until |