[zeromq-dev] 答复: How to catch SIGUSR1 in czmq?

yaqian wu yaqianwu08 at outlook.com
Tue Aug 9 04:33:28 CEST 2016


Thx all,I have solved this problem.I can use SIGUSR1 to interrupt str_recv function.


________________________________
发件人: zeromq-dev <zeromq-dev-bounces at lists.zeromq.org> 代表 Michael Haberler <mail17 at mah.priv.at>
发送时间: 2016年8月9日 7:38:49
收件人: ZeroMQ development list
主题: Re: [zeromq-dev] How to catch SIGUSR1 in czmq?


> Am 06.08.2016 um 09:00 schrieb yaqian wu <yaqianwu08 at outlook.com>:
>
> Hi
>      I want to catch and handle SIGUSR1 to interrupt zstr_recv function to terminate my child process.In ZSYS,I only find method to catch SIGINT and SIGTERM.
>      Can anyone help,ths.

Use signalfd() and monitor that file descriptor in the event loop. Then it's all in-band, not with the crazy signal handler semantics which is asking for trouble.

See https://github.com/machinekit/machinekit/blob/master/src/machinetalk/haltalk/haltalk_main.cc for example usage.

-m


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

_______________________________________________
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/20160809/b67755da/attachment.htm>


More information about the zeromq-dev mailing list