[zeromq-dev] recovering from an unanswered reply

Joshua Foster jhawk28 at gmail.com
Sat Aug 20 16:10:44 CEST 2011

The best way I have found is to use a Poller in addition to the REQ socket. It lets you set a timeout on the recv. If you don't recv in an expected time, do a resend (you may need to close and reconnect).


On Aug 20, 2011, at 6:44 AM, Mathijs Kwik wrote:

> Hi all,
> If process1 uses a REQ socket to send a message to process2, but
> process2 dies before replying, process1 gets stuck, waiting for an
> answer to arrive forever. Using identity doesn't help, since the
> message was already delivered.
> The socket doesn't allow sending new requests until the previous one
> gets answered.
> Do I need to create some kind of timeout mechanism to close/recreate/
> reconnect the socket if no response is received in time? And store the
> message temporarily, so I can resend it on timeout.
> Or is there a better/built-in way to handle this?
> Thanks,
> Mathijs
> _______________________________________________
> 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