[zeromq-dev] Signal handling in blocking zmq_recv

Martin Lucina mato at kotelna.sk
Tue Mar 9 19:50:17 CET 2010


chris at chriswongstudio.com said:
> Martin, thanks for the pointer to the zmq-camera example.  It handles SIGINT/SIGQUIT etc by exiting the process.  If I want to interrupt all the blocked zmq_recv calls when receiving a SIGINT, how would you suggest me approaching this problem?  zmq_recv seems to be blocked forever.

You can't do that (interrupt all blocking calls) right now without killing
the thread, or somehow signalling (e.g. via yet another inproc socket) to
tell it to go away. This is why zmq-camera does not try to do anything
better than exit().

Martin, I almost forgot, weren't we going to either change the default
behaviour of zmq_term() or add a flag to say "Please go away NOW!"?

-mato



More information about the zeromq-dev mailing list