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.

cr

On Jun 21, 2014, at 11:19 AM, Paulmichael Blasucci <[email protected]> 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
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to