In 3.1.0 beta, SUB and XSUB sockets default to LINGER 0 instead of -1 like other sockets
Description
Environment
unix & windows, 3.1.0 beta
Activity
Show:
Chuck Remes December 19, 2011 at 2:57 AM
Your suggestion to eliminate ZMQ_LINGER support for PULL, SUB and XSUB makes sense. It should return ENOTSUP or similar.
Martin Sustrik December 19, 2011 at 2:46 AM
Yes. The reason is that non-zero linger on (X)SUB socket causes zmq_term() to wait/hang if the subscriptions cannot be sent to the publisher. However, given that subscriber is already terminating, it makes no sense to send them at all.
As for the interaction with the user, showing the LINGER value to the user or even allowing him to set it to some value doesn't make much sense.
What about not supporting ZMQ_LINGER option on the socket types that can't be used for sending (PULL, SUB, XSUB)?
I understand that the concept of LINGER doesn't really apply to SUB/XSUB but I thought I would point it out. My ruby specs caught this so I figured I would put a note up here just in case this was due to a mistake.