[zeromq-dev] detecting disconnections

Attila-Mihaly Balazs x_at_y_or_z at yahoo.com
Wed Jan 11 06:55:49 CET 2012

+1 for bi-directional heartbeating. Real-life networks can have all 
kinds of weird situations like silently dropping packets in one 
direction or half-open connections [1] which can only be detected by 
heartbeating. Of course messages received should count as heartbeats for 

Attila Balazs

PS. Even more precisely any partial message read should count as a 
heartbeat, otherwise reading large messages can cause a disconnect on an 
otherwise clearly healthy connection.

[1] http://www.evanjones.ca/tcp-stuck-connection-mystery.html
> By experience, heartbeating should happen every 2-5 seconds. Ymmv.
> On Jan 9, 2012 5:56 PM, "Yi Ding" <yi.s.ding at gmail.com 
> <mailto:yi.s.ding at gmail.com>> wrote:
>     On Mon, Jan 9, 2012 at 3:26 PM, Pieter Hintjens <ph at imatix.com
>     <mailto:ph at imatix.com>> wrote:
>     > On Mon, Jan 9, 2012 at 7:19 AM, Yi Ding <yi.s.ding at gmail.com
>     <mailto:yi.s.ding at gmail.com>> wrote:
>     >
>     >> Would it be difficult to implement in the ZeroMQ framework?  I'm
>     >> willing to give it a shot if it doesn't clash with the fundamental
>     >> design.  This is pretty useful, especially in the finance industry,
>     >> where "cancel on disconnect" has become a necessity.
>     >
>     > I'd use heartbeating. Some network errors won't show up as
>     > disconnections and you need heartbeating in any case.
>     >
>     > -Pieter
>     I'm going to have heartbeating as well, but it would also be nice to
>     have a disconnect notification.  The reason is that to keep network
>     traffic down, heartbeating has to be done on a relatively long time
>     horizon (I'm thinking 60 seconds apart) and in financial markets, a
>     lot can happen over the period of a second or two.
>     _______________________________________________
>     zeromq-dev mailing list
>     zeromq-dev at lists.zeromq.org <mailto: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/20120111/5e8c1c03/attachment.htm>

More information about the zeromq-dev mailing list