ZMQ_ROUTER_MANDATORY doesn't kick in on disconnected peer
Description
Environment
None
Activity
Show:

Christian Kamm June 24, 2013 at 7:43 PM
I'm using this issue to learn more about the zmq internals, here's what I've found so far.
It seems several roundtrips between dealer, io threads and router are needed until the router notices the peer has disconnected.
The code below is similar to the test case linked above but uses zsocket_poll() to trigger command evaluation on the sockets and zclock_sleep() to process commands on the io threads. That way the expected value is returned. It's annotated to show what commands are exchanged.
How would one go about removing this delay?

PieterP December 11, 2012 at 10:51 AM
Test case is here: https://github.com/zeromq/issues/blob/master/479/issue.c
When a peer disconnects, a ROUTER sending to the peer should get an error when sending and ZMQ_ROUTER_MANDATORY is set. However libzmq doesn't appear to raise any error.