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

Robert Holterhoff datax1969 at gmail.com
Mon Apr 4 04:31:31 CEST 2016

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.


Rob Holterhoff

More information about the zeromq-dev mailing list