[zeromq-dev] adding timeout in zmq_poll

Martin Sustrik sustrik at 250bpm.com
Tue Dec 29 07:56:55 CET 2009


Hi Pavel,

> I did patch, but when i tried to test it, something goes wrong. I
> tried my test program on unmodified zmq2 and get same problem.
> 
> I attached modified display.cpp (that binds to some address) and
> prompt.cpp that connects to it. When i try to start display:
> ./display tcp://127.0.0.1:5000
> i get error:
> Assertion failed: false (sub.cpp:155)
> 
> What i'm doing wrong?

There was a missing piece of code in SUB socket. Fixed in trunk (72161fb).

> I found discrepancy in zmq_poll manpage. in zmq_pollitem_t section
> ZMQ_POLLIN and ZMQ_POLLOUT is discussed, but in example section only
> POLLIN is used.

The problem is that until watermarks are ported to 0MQ/2.0 you can 
_always_ write to a socket. Thus polling for ZMQ_POLLOUT never blocks at 
the moment.

Martin



More information about the zeromq-dev mailing list