[zeromq-dev] first message never received when SUB binds (0MQ 3)

Pieter Hintjens ph at imatix.com
Sun Sep 4 21:10:22 CEST 2011


MinRK,

Would you create an issue for this? I'll make a test case for it then.

-Pieter

On Sun, Sep 4, 2011 at 8:47 PM, MinRK <benjaminrk at gmail.com> wrote:
> When binding with SUB, and connecting with PUB, it seems impossible to
> receive the first message.
> Failing example (Python):
> import zmq
> ctx = zmq.Context()
> pub = ctx.socket(zmq.PUB)
> sub = ctx.socket(zmq.SUB)
> sub.bind('tcp://127.0.0.1:5555')
> sub.setsockopt(zmq.SUBSCRIBE, '')
> # sleeping here makes no difference
> pub.connect('tcp://127.0.0.1:5555')
> # sleeping here makes no difference
> pub.send('hi')
> sub.recv() # never arrives
> all subsequent messages behave as expected, and the first message arrives as
> expected when the bind/connect is reversed.
> This is new behavior in 3.0. The first message arrives just fine in 2.x.
> -MinRK
> _______________________________________________
> 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