[zeromq-dev] Dropped messages when not sleeping, using 0MQ 2.1.x

Wolfgang Richter wolf at cs.cmu.edu
Sun Sep 18 18:24:42 CEST 2011


My thoughts too Martin.  I'm wondering if you will need an out of band
signaling mechanism for this Jim?

--
Wolf

On Sun, Sep 18, 2011 at 12:22 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:

> On 09/18/2011 05:52 PM, James Cipar wrote:
>
>
> > int linger; size_t l_size = sizeof(linger);
> > sender.getsockopt(ZMQ_LINGER, (void *)(&linger),&l_size);
> > assert(l_size == sizeof(linger)); cout<<"closing sender, messages
> > will linger for"<<linger<<" milliseconds\n"; sleep(1);
> > sender.close();
> >
> > If that "sleep" call is commented out, it will drop messages; with
> > the sleep, it will not.  The "cout" is printing -1, as expected.
> >
> > Is there any reason to expect this system to be dropping messages?
>
> Are you calling zmq_term() before exiting the sending process? Note that
> zmq_close() is non-blocking. Actual waiting while pending messages are
> being sent happens in zmq_term().
>
> Thus, if you simply exit() the process, pending outbound messages will
> do dropped.
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110918/d419c5bf/attachment.htm>


More information about the zeromq-dev mailing list