[zeromq-dev] Sending via ROUTER socket to ROUTER socket fails initially with "No route to host"
Pieter Hintjens
ph at imatix.com
Thu Apr 11 09:50:03 CEST 2013
On Tue, Apr 9, 2013 at 10:39 PM, Anoop Karollil
<anoop.karollil at gmail.com> wrote:
> But I am guessing since the connect should succeed even if the peer
> hasn't bound, it would be hard to wait till the handshake happens, as it
> could potentially take forever.
Waiting for the peer to send its identity would be nasty, turning the
async connect into a blocking call with all the exceptions (timeouts,
etc.)
The simplest is really to handle the error with a retry IMO, if you
expect peers to be available immediately.
I've made a small change to the zmq_connect man page to be more
explicit. But really, ROUTER-to-ROUTER is delicate since you only
really know when you can send to a peer when it's already sent you a
message.
-Pieter
More information about the zeromq-dev
mailing list