On 23 May 2016 at 10:23, Huttunen, Kalle (GE Healthcare) < [email protected]> wrote:
> It seems that sending on the socket makes the ZMQ_FD readable. That in > turn triggers the calling of the code where I check ZMQ_EVENTS and receive > everything from the socket. This way I end up checking ZMQ_EVENTS after > each send. > > Is the ZMQ_FD becoming readable when sending on the socket something that > can be relied on? > I believe you have a race condition. If a message arrives after your call to zmq_recv(), but before your call to select() / poll(), it will block despite there being a message ready. If you can tolerate messages being delayed, there is an simple workaround in which you call zmq_recv() periodically. We have code doing this by specifying a timeout in the select() call. Dave
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
