[zeromq-dev] ZMQ_SERVER blocks on send() rather than returning EAGAIN

Doron Somech somdoron at gmail.com
Mon Apr 4 10:04:20 CEST 2016

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 <datax1969 at gmail.com>

> 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
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160404/a1e43ba3/attachment.htm>

More information about the zeromq-dev mailing list