[zeromq-dev] correct way to safely hanging up a socket

Chuck Remes cremes.devlist at mac.com
Thu Jan 20 05:39:05 CET 2011

On Jan 19, 2011, at 10:14 PM, Seth Burleigh wrote:

> Im having the same problems as the link below. I would like to close a socket - but while im closing it, it is possible that other messages are already in my sockets queue. Thus, when i close it, messages are lost.  ideally, a socket could be closed but the queue could still be processed. What is the correct way to do this? Sure, you could use the solution described below, but it seems rather like a hack.
> Questions related to this on stackoverflow:
> http://stackoverflow.com/questions/3692854/how-should-a-zeromq-worker-safely-hang-up

Upgrade to version 2.1.0 and take a look at the new LINGER socket option. It allows you to specify a timeout on the socket to ensure all messages are sent before it is closed.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110119/c554f6d1/attachment.htm>

More information about the zeromq-dev mailing list