[zeromq-dev] subscriber stops receiving messages after reconnect

Petr Postulka ppostulka at gmail.com
Tue Dec 17 16:41:13 CET 2013

Hi Pieter,

thank you for your quick reply. Your suggested solution is exactly
what we were thinking about, but I just wanted to ask if there is some
better/automatic way to handle such scenarios.

Are you planning to enhance the library in the future with something
like heartbeating, so scenarios like the one described above will be
automatically covered, so we don't need to implement the heartbeating
mechanism in every application? I think it would be nice addition if
zeromq itself is able to detect all sorts of disconnections and handle
them properly.

Thank you.


On Tue, Dec 17, 2013 at 4:29 PM, Pieter Hintjens <ph at imatix.com> wrote:
> On Tue, Dec 17, 2013 at 3:41 PM, Petr Postulka <ppostulka at gmail.com> wrote:
>> If we monitor
>> the socket state via Socket Monitor API, the subscriber does not
>> recognize the disconnection at all.
> That is possible, and there is no way to automatically fix this.
> Manual workaround: publisher should send a heartbeat ever second
> (client should subscribe to those), and if subscriber gets no data and
> no heartbeat for >1 second, it closes socket and reconnects. You can
> raise or lower frequency of heartbeats depending on needs.
> -Pieter
> _______________________________________________
> 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