[zeromq-dev] signal handling using czmq

Pieter Hintjens ph at imatix.com
Wed Sep 17 20:27:48 CEST 2014


In a signal handler you cannot do any real work. You can set a flag,
and detect that somewhere else.

On Mon, Sep 15, 2014 at 7:52 AM, Raju Kundhe <raju2082 at gmail.com> wrote:
> Hi,
>
>       I've an error message while destroying 'zmq context'  in my signal
> handler.
> Assertion failed: pfd.revents & POLLIN (signaler.cpp:159)
> Aborted
>
> I looked here :: It say's the error is because of using the socket after
> closing the context.
>
> But, I'm closing the context in my signal handler. am I doing wrong?
>
>
>
> On Sat, Aug 23, 2014 at 1:28 AM, Pieter Hintjens <ph at imatix.com> wrote:
>>
>> ZMQ does no signal handling.
>>
>> On Fri, Aug 22, 2014 at 7:42 AM, Raju Kundhe <raju2082 at gmail.com> wrote:
>> > It's working now!!
>> >
>> > Thank you very much Pieter Hintjens.
>> >
>> > what signals does zmq supports? and how are they initialized?
>> >
>> >
>> >
>> >
>> > On Thu, Aug 21, 2014 at 6:47 PM, Pieter Hintjens <ph at imatix.com> wrote:
>> >>
>> >> Can you build CZMQ master (from git); this has been fixed.
>> >>
>> >> On Thu, Aug 21, 2014 at 3:04 PM, Raju Kundhe <raju2082 at gmail.com>
>> >> wrote:
>> >> > Hi Pieter,
>> >> >
>> >> > Thank you for your reply!!
>> >> >
>> >> > I tried with zsys_handler_set (NULL);
>> >> >
>> >> > zsys.c:331: zsys_handler_set: Assertion `handler_fn' failed.
>> >> >
>> >> > Regards
>> >> > raju
>> >> >
>> >> >
>> >> > On Thu, Aug 21, 2014 at 5:59 PM, Pieter Hintjens <ph at imatix.com>
>> >> > wrote:
>> >> >>
>> >> >> CZMQ does set up its own signal handling to trap SIGINT and SIGTERM.
>> >> >> You can disable this by calling
>> >> >>
>> >> >>     zsys_handler_set (NULL);
>> >> >>
>> >> >> -Pieter
>> >> >>
>> >> >> On Thu, Aug 21, 2014 at 1:53 PM, Raju Kundhe <raju2082 at gmail.com>
>> >> >> wrote:
>> >> >> > Hello,
>> >> >> >
>> >> >> > I'm using `czmq` and `zmq` libraries in my code. I've registered a
>> >> >> > signal
>> >> >> > handler for `SIGINT` by calling `signal` in main.
>> >> >> >
>> >> >> > see code here
>> >> >> >
>> >> >> > The above code doesn't get into signal handler when `ctrl+c`
>> >> >> > interrupt
>> >> >> > is
>> >> >> > given.
>> >> >> >
>> >> >> > what is the problem with `czmq` or `zmq` library and how it should
>> >> >> > be
>> >> >> > handled?
>> >> >> >
>> >> >> > I read that, zctx set's up it's own signal handler. But, my
>> >> >> > program
>> >> >> > doesn't
>> >> >> > terminate when ctrl+c is given even without using any signal
>> >> >> > handler'
>> >> >> > s
>> >> >> > ( I
>> >> >> > mean, default case should be handled? ).
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > 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
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > 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
>> >
>> >
>> >
>> > _______________________________________________
>> > 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
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list