[zeromq-dev] Sending via ROUTER socket to ROUTER socket fails initially with "No route to host"

Anoop Karollil anoop.karollil at gmail.com
Tue Mar 26 17:29:53 CET 2013

On 13-03-25 11:14 PM Pieter Hintjens <ph at imatix.com> wrote to ZeroMQ 
development list <zeromq-dev at lists.zeromq.org> :

> On Tue, Mar 26, 2013 at 12:53 AM, Anoop Karollil
> <anoop.karollil at gmail.com> wrote:
>> When I try sending messages via a ROUTER socket to a ROUTER socket (both
>> having their identities set), with ZMQ_ROUTER_MANDATORY set, the initial
>> send of the destination sock identity (sent before actual message for
>> routing) fails once, but succeeds after.
>  From the zmq_bind man page:
> "following a zmq_bind(), the socket enters a mute state unless or
> until at least one incoming or outgoing connection is made, at which
> point the socket enters a ready state. In the mute state, the socket
> blocks or drops messages according to the socket type, as defined in
> zmq_socket(3). By contrast, following a libzmq:zmq_connect[3], the
> socket enters the ready state."

Pieter, the second socket does make a connection to the URI bound to by 
the first socket before it sends the message.

Or by connection does the manual mean the actual underlying TCP 
connection? And that it gets made only when an initial message is sent 
to the bound socket and not when the connect call is done?

If that is the case, there is no getting around having to resend the 
first message that you send to a bound socket because it will always be 
in a mute state initially?


More information about the zeromq-dev mailing list