Yeah, I'll probably go this way. The thing is that publisher did not die, it's the router in-between them that gone away suddenly (crashed in a way similar to unplugging it or separating network physically without letting the endpoints know about it).
IMO tcp keepalive that you have in 3.1 could be helpful to deal with situation like this in future. Thanks! Alex. On Fri, Jun 1, 2012 at 5:20 PM, Pieter Hintjens <p...@imatix.com> wrote: > On Fri, Jun 1, 2012 at 9:37 PM, Alex Sergeyev <a...@alexsergeyev.com> wrote: > >> One router core-dumped today. Subscriber behind it never realized that >> it's time to reconnect and kept waiting for messages until I realized >> that data is not there... Do you know what is the scenario of events >> for such situation? How long would've that continued until anything >> (OS or ZMQ) would've closed that socket? >> >> Should I have application - level fix for such situation or there is >> some ZMQ socket option that I could've used? > > Normally if the publisher restarts, the subscriber socket will > reconnect automatically. There is no 0MQ option for the subscriber to > give up. You can add this quite easily... send a heartbeat if there is > no other data going out, then if there's no heartbeat after a timeout, > the subscriber knows the publisher is dead or frozen. > > -Pieter > _______________________________________________ > zeromq-dev mailing list > zeromq-dev@lists.zeromq.org > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev