[zeromq-dev] Issue 85 & 92

Martin Sustrik sustrik at 250bpm.com
Tue Oct 26 17:27:51 CEST 2010


On 10/26/2010 05:08 PM, ntupel at googlemail.com wrote:

> My question is - how am I supposed to cleanly shutdown my application,
> given that I can't invoke zmq_close on S from T2 and T1 is stuck in a
> blocking call?

Irrespective to use of multicast, the termination sequence goes like this:

1. Thread A closes all its sockets and invokes zmq_term.
2. zmq_term blocks
3. Other threads will get ETERM error when invoking any 0mq function 
afterwards.
4. They should close all their sockets and terminate.
5. When all the sockets are closed and there are no more data to send, 
zmq_term unblock and original thread is free to terminate.

Martin



More information about the zeromq-dev mailing list