[zeromq-dev] Heartbeats and/or keep-alives

Martin Lucina mato at kotelna.sk
Wed Oct 13 16:26:04 CEST 2010


ph at imatix.com said:
> You're hitting an issue that most 0MQ users come to sooner or later.
> 0MQ sockets do not, currently, do any kind of heartbeating over TCP
> though this is something I'm pretty sure they eventually will need to
> do.
> 
> The solution is fairly simple, add heartbeating to whatever protocol
> you are building on top of your 0MQ sockets.  That sounds complex but
> it really is pretty simple to add socket flows into a 0MQ application.
>  So typically you create a socket pair that pushes heartbeats up from
> client to server (or whatever), or you add heartbeat messages into the
> other traffic.

In Marcelo's specific case he will need to add it into other traffic;
adding an extra socket won't help since his network will still declare the
normal idle connection dead, so the hearbeat (or in this case keepalive)
needs to travel along each TCP connection that might become idle.

-mato



More information about the zeromq-dev mailing list