[zeromq-dev] CZMQ: zloop_poller terminates the function handler

Shrikanth M.D. shrikanthdiwakar at gmail.com
Tue Jan 17 16:58:50 CET 2017


Hello,

I think I fixed the issue. It was due to invoking zstr_free inside the
handler without passing the address of the pointer.
zstr_free(msg) --> Lead to termination of poller
zstr_free(&msg) --> Fixed the issue .i.e. event handler is not being
terminated anymore. I guess any error inside the handler leads to poller
termination as per CZMQ implementation.

Nevertheless, I have another query regarding timers.
Timer expired for 400
Timer expired for 200
Timer expired for 100
Timer expired for 300
Timer expired for 400

Numbers that you see above are some object IDs. Each timer for each object
ID expires after a time interval of 15000 ms.
As per the scenario that I am trying to design when the poller socket has
an event (some message), I cancel the timer of these objects.

I see that the timer cancellation with zloop_timer_end --> leads to handler
termination.
Below is the code snippet.
[image: Inline image 1]


I see my program exits when I cancel some timers upon receving the message
on the poller socket.
Is it that I should wait until a particular timer_id expires and its handle
is triggered so that the timer could be cancelled from within the handler?

Please suggest.

thanks & regards,
Shrikanth



On Tue, Jan 17, 2017 at 11:42 AM, Luca Boccassi <luca.boccassi at gmail.com>
wrote:

> On Tue, 2017-01-17 at 00:42 +0100, Shrikanth M.D. wrote:
> > Hello All,
> >
> > I have a zloop_poller invoked as below:
> > zloop_poller (loop, &item, s_netconf_socket_event,inter_thread_pair);
> >
> >
> > I see that while executing the function handles, s_netconf_socket_event,
> my
> > program terminates.
> > I have added debugs and see no obvious issues with my program.
> >
> > Is there any explicit cause due to which czmq would end the handler by
> > itself?
> >
> > Regards,
> > Shrikanth
>
> Can you provide a code snippet that reproduces the case?
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170117/d856f0f1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 92382 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170117/d856f0f1/attachment.png>


More information about the zeromq-dev mailing list