Commit bba4a937 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #2622 from msune/master

Fix ROUTER's xhas_out() in MANDATORY mode
parents 30ab0ed8 b7b89a8f
...@@ -423,10 +423,19 @@ bool zmq::router_t::xhas_in () ...@@ -423,10 +423,19 @@ bool zmq::router_t::xhas_in ()
bool zmq::router_t::xhas_out () bool zmq::router_t::xhas_out ()
{ {
// In theory, ROUTER socket is always ready for writing. Whether actual // In theory, ROUTER socket is always ready for writing (except when
// attempt to write succeeds depends on which pipe the message is going // MANDATORY is set). Whether actual attempt to write succeeds depends
// to be routed to. // on whitch pipe the message is going to be routed to.
return true;
if(!mandatory)
return true;
bool has_out = false;
outpipes_t::iterator it;
for (it = outpipes.begin (); it != outpipes.end (); ++it)
has_out |= it->second.pipe->check_hwm();
return has_out;
} }
zmq::blob_t zmq::router_t::get_credential () const zmq::blob_t zmq::router_t::get_credential () const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment