[zeromq-dev] PUB doesn't discard msg when no SUB

Ian Barber ian.barber at gmail.com
Thu May 26 20:13:11 CEST 2011


On Thu, May 26, 2011 at 5:57 PM, Li, Jia <jia.li at credit-suisse.com> wrote
>
> The problem I see is that if the SUB starts after the PUBs, it still
> receive all the messages sent before. This seems to contradict to what the
> documentation said.
>
> However, if I have only one PUB and one SUB, and I reverse the connect/bind
> by having PUB bind() and SUB connect(), I get the documented behavior in
> which SUB doesn't receive historical messages.
>
It's just as artifact of how the connection handling works - if you connect
the PUB it doesn't discard the messages as it is automatically trying to
establish the connection - the PUB that is binding knows it has no
connections so drops the messages.

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


More information about the zeromq-dev mailing list