On 2012-07-28 12:52, Bjorn Reese wrote:

> 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.)

While delving deeper into this problem, I discovered that the
ZMQ_ROUTER_BEHAVIOR option is more or less what I am looking for.

If this option is enabled, the call to zmq_send() will block until the
identity has been exchanged, thus making the sleep() superfluous. If
zmq_send() is called with ZMQ_DONTWAIT, it will return EAGAIN, which is
exactly as I requested in #2 above.

In the non-blocking case it may still be a good idea to receive an
event when the identity has been exchanged, so I will look further
into that.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to