[zeromq-dev] flushing messages on PULL socket before close()ing?

Ian Barber ian.barber at gmail.com
Fri May 11 14:40:51 CEST 2012

On Fri, May 11, 2012 at 12:51 PM, Alexander Voss <alexvoss.uk at gmail.com>wrote:

> So, is there a way to tell ZeroMQ to stop receiving new messages so I
> can process all that has already been received before calling close?
> Have I got the wrong end of the stick altogether?
> Cheers,
> Alex

In general, if you do a non-blocking recv() before doing a zmq_close, you
can make sure there's nothing in the queue, but there is still a chance of
a message being received before the socket is terminated.  If you're using
libzmq master, then Sergey Hripchenko's disconnect options might be a good
way to disconnect the endpoint before shutting down the socket. That said,
we're still missing documentation for that at the moment, I might try and
drop something in.

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

More information about the zeromq-dev mailing list