[zeromq-dev] SUB socket missing last message if it's large, RCVBUF increases help

Iverson, John Robert jrivers at sandia.gov
Tue Sep 25 16:53:40 CEST 2012

So I've run into an issue with ØMQ 2.2.0.  I'm using C++ bindings on a linux machine.

Basically the last message sent from my PUB socket is never delivered to the SUB socket.  I haven't changed ZMQ_LINGER so it's still set to "forever".  It only happens on larger messages (say, 350kb), and my little repeatable program shows the issue every time.

All except the very last message are delivered fine.  I'm letting the zmq::context_t be destructed (and thus zmq_term be called).

If all the messages are sent by the sender before I start the receiver, the problem goes away.

If I add a sleep(5) to the sender after sending the last message, the problem goes away.

Increasing ZMQ_RCVBUF lets slightly larger messages to through but even-larger ones still have a problem.

Example code is at http://pastebin.com/SnhqKRaa

Does this sound like a bug, or am I most likely just missing something?  Thanks!


More information about the zeromq-dev mailing list