[zeromq-dev] Sub problem

Pieter Hintjens ph at imatix.com
Fri Dec 14 00:29:27 CET 2012

On Fri, Dec 14, 2012 at 12:23 AM, Stefan de Konink <stefan at konink.de> wrote:

> The same (local) iptables as before, just accept/drop, without any
> connection tracking what so ever.

I recall last time you found the problem didn't happen when you
connected directly, only when you went via iptables? So it's
definitely doing *something*.

>> If this is happening, consider sending keep-alive messages from PUB to
>> SUB, which the SUB can discard (but must subscribe to, in 3.2).
> I was considering this, and using zmq_poll to actually timeout and
> reconnect. Would you be interested in a tcpdump of a (failed) test?

No, but thanks for the offer. Yes, definitely use zmq_poll to timeout,
and reconnect. However if TCP reports an error the SUB socket will
reconnect automatically.

What you have to do (and this is pretty standard across any protocol)
is do your own keep-alive to keep the "I'm really not messing with
your connections, promised!"* proxy in the middle out of trouble.

PUB socket sends a null message once a second; SUB gets that (must
subscribe to it!) and discards it. If SUB doesn't get null message
after X seconds, decides that PUB is dead so looks for backup.


* It really is messing with your connections.

More information about the zeromq-dev mailing list