[zeromq-dev] cppzmq - how to use ::monitor_t properly?

Attila Magyari atti86 at gmail.com
Fri May 25 10:59:22 CEST 2018


Thanks Francesco,
I also used a separate thread for the monitoring, but as you said, if I
create more sockets, I will be spawning new running threads which I can't
join anymore. Doesn't sound like a good design :).

On Fri, May 25, 2018 at 10:53 AM Francesco <francesco.montorsi at gmail.com>
wrote:

> Hi Attila,
> I use the zmq::monitor_t::monitor() call from the context of a secondary
> thread. In practice every time I want to monitor a socket (mostly for
> debugging) I create a new thread dedicated to its monitoring. This is an
> easy solution although probably is not the best one, specially if you need
> to monitor several sockets...
>
> HTH,
> Francesco
>
>
> 2018-05-25 9:09 GMT+02:00 Attila Magyari <atti86 at gmail.com>:
>
>> Hello,
>>
>> How do you use the cppzmq's zmq::monitor_t::monitor() call correctly? It
>> is an infinitely blocking method, and I don't know how to exit from it
>> gracefully.
>>
>> Is the use of socket monitoring discouraged? Are there better
>> alternatives to get connection status of the socket?
>>
>> Thank you!
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
> _______________________________________________
> 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/20180525/f611fc4e/attachment.htm>


More information about the zeromq-dev mailing list