[zeromq-dev] Questions about Shutdown

Charles Remes lists at chuckremes.com
Sat Jun 21 18:32:28 CEST 2014

Your original sequence is correct. No one has been recommending swapping the order of 4 & 5.

You could try and terminate a context in a thread, but it will *block* until all sockets close and clean up. Unless you want this behavior, you should clean up sockets first.


On Jun 21, 2014, at 11:19 AM, Paulmichael Blasucci <pblasucci at gmail.com> wrote:

> So, after 3 years of putting ZMQ in production, I'm worried I may be operating under mistaken assumptions. In the guide (and in my code), there is a fairly consistent pattern:
> 1. Create/configure context
> 2. Create/configure sockets
> 3. Actual code which uses sockets
> 4. Clean up sockets 
> 5. Clean up context
> This seems quite logical, and has served me quite well. However, after some recent discussions, I'm concerned the last two steps above can, on occasion, be reversed. In other words, an application may (intentionally) dispose of the context while one, or more, sockets are still "live". Is this true? If so, can anyone elaborate on when this is necessary?
> Thanks!
> _______________________________________________
> 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/20140621/9bcef049/attachment.htm>

More information about the zeromq-dev mailing list