On 11/27/2010 10:53 PM, Chuck Remes wrote:
> Let's assume that zmq_term() calls zmq_close() on each known socket.
>
> Why can't zmq_term() block for a *maximum* of milliseconds as set on each 
> socket by the ZMQ_LINGER option? If the goal is to avoid dropping packets 
> when exiting, then zmq_term() can interrupt those sockets (so that no 
> additional messages can be queued) and then wait ZMQ_LINGER milliseconds 
> before socket termination is complete.
>
> At that point, the context should be able to exit cleanly.
>
> Doesn't that solve the original problem of dropping packets on exit? What am 
> I missing?
>    
The fact that there may be other threads still running and using the 
sockets. You cannot deallocate a socket while it is still in use by 
another thread.

Martin

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to