[zeromq-dev] zmq_term() blocks in 2.1

Chuck Remes cremes.devlist at mac.com
Tue Jan 11 01:36:19 CET 2011

On Jan 10, 2011, at 6:26 PM, David Kantowitz wrote:

> Hello,
> In v2.1 zmq_term() will block if there are any open sockets -- in previous versions of ZMQ zmq_term() was non-blocking.
> For my application this causes problems, so I've changed my copy of ctx::terminate() to be non-blocking.  I issue all the stop() calls and return EAGAIN if there are sockets other then the logging socket open.  
> However I didn't see an obvious way to extend the ZMQ API (ex, context level option) to support both behaviors so there isn't much point in submitting my change ... it would be wrong for the people who want a blocking zmq_term().
> I do think it is worth having non-blocking support.  Since an API change or addition seems necessary, perhaps it would be good to add this before 2.1 is finalized. 
> How are issues like best captured?  Should I submit a bug report somewhere?

This topic has been discussed numerous times on the list so I suggest you search through some of the old threads to become familiar with the main developer's responses. 

While I think Martin is considering some kind of change to allow zmq_term() to return EAGAIN, such a change would break the existing API contract for 2.1 which *is* finalized. Any change to this behavior would be part of a 2.2 (or later) branch.


More information about the zeromq-dev mailing list