[zeromq-dev] Router to router delay

Bjorn Reese breese at mail1.stofanet.dk
Sat Jul 28 12:52:01 CEST 2012


I am writing a peer-to-peer system on top of a router-to-router
connection. As there can be multiple peers, I set their identity.

It appears that router pairs have to exchange their identity before
they can exchange messages. Any message I send before the identity
is exhanged, are silently discarded.

The only solution I have seen to this problem, is to sleep for one
second before sending the first message. Unfortunately, there is no
guarantee that one second is sufficient. A slow connection may take
longer than one second to exchange the identity. So this is not a
feasible solution.

I see three alternatives:

1. Let ZeroMQ queue the messages and send them once the identity has
    been exchanged. This is my preferred solution seen from a users
    point of view.

2. Let zmq_send() return EAGAIN until the identity has been exchanged.

3. Add an event to notify the application that the identity has been
    exchanged (e.g. via the new zmq_ctx_monitor_event() functionality.)



More information about the zeromq-dev mailing list