[zeromq-dev] odd zmqstream.py behavior

Pieter Hintjens ph at imatix.com
Sat Oct 2 03:52:14 CEST 2010


If you're using 0MQ/2.0.x then when you close a socket any messages
still in flight (which means the ones you just sent) are dropped.
This is presumably what you're seeing.  It's fixed in 2.1.

On Fri, Oct 1, 2010 at 9:09 PM, Steve Huffman <steve at hipmunk.com> wrote:
> Hi All,
> I'm using pyzmq and zmqstream and have encountered what I think is an error.
> My code looks like this:
> s = ctx.socket(zmq.PUSH)
> s.bind('tcp://127.0.0.1:5555')
> self.stream = zmqstream.ZMQStream(s, loop)
> self.stream.on_send(echo)
> def echo(*a, **kw):
>     blah
>
> The on_send callback, echo(), has an deliberate error in it. If an exception
> occurs in _run_callback in zmqstream.py, the call to self.close() fails (it
> never returns). I've managed to follow this to the eventual call to
> zmq_close() in _zmq.pyx/_zmq.c, but don't know enough about zeromq to debug
> further.
> Thanks,
> Steve
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>



-- 
-
Pieter Hintjens
iMatix - www.imatix.com



More information about the zeromq-dev mailing list