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

James Cipar jcipar at cmu.edu
Sun Sep 18 18:50:33 CEST 2011


The process is not exiting.  It's waiting for more work (calling recv on a different 0MQ socket).  The PULL process exits after it receives all of the "end" messages, but that's not actually happening.


On Sep 18, 2011, at 12:24 PM, Wolfgang Richter wrote:

> 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
> 




More information about the zeromq-dev mailing list