zeromq/libzmq — pull request #774 by shubred1 (2013-12-04 23:06:19+00:00)
Title: Updated documentation for zmq_disconnect() and zmq_setsockopt().

Updated the documentation to match the changes made in pull request 627. Essentially copied the ZMQ_LINGER related information from zmq_close() to zmq_disconnect(), and updated zmq_setsockopt() to reference zmq_disconnect() as well as zmq_close().

I've verified that the underlying linux socket associated with a ZMQ_DEALER is released when a message has not yet been sent when ZMQ_LINGER is set to 0 when zmq_disconnect() is called (and that it is not released when the ZMQ_LINGER option is left at default -1). This was done by having the peer IP not existing on the network. In this scenario connecting, sending and disconnecting repeatedly left multiple opened linux sockets on the client.

I did not verify that received messages were discarded but it seems reasonable.