[zeromq-dev] PUB/SUB message lost if sent after connect()

Tomaz Beltram tomaz.beltram at topit.si
Tue Aug 27 09:52:58 CEST 2019


Hi,

I use pub/sub pattern to deliver events and have noticed that some
messages get lost. I make sure that subscriber binds to the socket and
waits in recv() before the publisher sends the event. I was able to
reproduce this issue when the publisher calls send() immediately after
connect(). If there is a 1ms sleep in between two calls the message is
received. Sample code is here: https://pastebin.com/TjUtfFgp

Is this expected behaviour, bug or am I missing some important socket
options?

The OS is Ubuntu 18.04 with libzmq5.

wbr Tomaz




More information about the zeromq-dev mailing list