diff options
author | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:25 +0100 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:25 +0100 |
commit | 5ba1cb20fe6f6699cef1cc726718e760cd4c9af1 (patch) | |
tree | df7b144c5325fd8b3c88c49b456fafc24249abe6 /src/xreq.cpp | |
parent | a15854bd92db69fcd0b4444fe1b8fe3610a7acf6 (diff) |
Imported Upstream version 2.0.9.dfsgupstream/2.0.9.dfsg
Diffstat (limited to 'src/xreq.cpp')
-rw-r--r-- | src/xreq.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/xreq.cpp b/src/xreq.cpp index ab90f68..66e5cc3 100644 --- a/src/xreq.cpp +++ b/src/xreq.cpp @@ -23,8 +23,7 @@ #include "err.hpp" zmq::xreq_t::xreq_t (class app_thread_t *parent_) : - socket_base_t (parent_), - dropping (false) + socket_base_t (parent_) { options.requires_in = true; options.requires_out = true; @@ -78,25 +77,7 @@ int zmq::xreq_t::xsetsockopt (int option_, const void *optval_, int zmq::xreq_t::xsend (zmq_msg_t *msg_, int flags_) { - while (true) { - - // If we are ignoring the current message, just drop it and return. - if (dropping) { - if (!(msg_->flags & ZMQ_MSG_MORE)) - dropping = false; - int rc = zmq_msg_close (msg_); - zmq_assert (rc == 0); - rc = zmq_msg_init (msg_); - zmq_assert (rc == 0); - return 0; - } - - int rc = lb.send (msg_, flags_); - if (rc != 0 && errno == EAGAIN) - dropping = true; - else - return rc; - } + return lb.send (msg_, flags_); } int zmq::xreq_t::xrecv (zmq_msg_t *msg_, int flags_) @@ -111,8 +92,6 @@ bool zmq::xreq_t::xhas_in () bool zmq::xreq_t::xhas_out () { - // Socket is always ready for writing. When the queue is full, message - // will be silently dropped. - return true; + return lb.has_out (); } |