If we create a router, and ZMQ_ROUTER_MANDATORY is set to 1, ZMQ_SNDTIMEO is set to -1(default value is -1, infinite),when a peer SNDHWM is reached, we send a message to this peer, at this time the peer disconnected, We will observe that this situation will cause the function to be blocked forever.
If we create a router, and ZMQ_ROUTER_MANDATORY is set to
1
, ZMQ_SNDTIMEO is set to-1
(default value is -1, infinite),when a peer SNDHWM is reached, we send a message to this peer, at this time the peer disconnected, We will observe that this situation will cause the function to be blocked forever.We can find this bug through the following code: