You have to specify ZMQ_DONT_WAIT for the send method to return eagain instead of blocking.
On Mon, Apr 4, 2016 at 5:31 AM, Robert Holterhoff <[email protected]> wrote: > I'm using the "unstable" 4.2.0 release and have a question regarding > ZMQ_SERVER sockets. > > The documentation suggests that ZMQ_SERVER sockets will not block but > return EAGAIN when the HWM is reached. I am finding that the send() > blocks instead. > > Actually, this is exactly the behaviour I want so I'm not complaining. My > app works beautifully, running at full rate, quickly filling up various > clients queues and then automatically rate-limiting to the slowest client > because of the blocking behaviour. > > However, I made the observation that the "back-off" part of the code which > I had written expecting EGAIN to be returned is never exercised. > > I just want to know if I can rely on this behaviour in the future so I can > remove my hacky arbitrary "sleep-for-a-bit back-off" code, or if this is a > bug because SERVER/CLIENT sockets are still in their infancy. > > Thanks, > > Rob Holterhoff > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
