[zeromq-dev] [PATCH] Add ZMQ_RCVTIMEO/SNDTIMEO sockopt (fix)

Martin Sustrik sustrik at 250bpm.com
Sun Jun 12 17:22:49 CEST 2011

Hi Fabien,

> That's make the code quite more complex to keep the exact same code
> path.  We need to go back to the old three cases (Windows,
> MSG_DONTWAIT and pure BSD) when timeout is -1, as well as to handle
> the MSG_DONTWAIT special case when timeout != -1.  I will do that, but
> I'm not sure it worth the added complexity.  May be we could instead
> work on an optimized internal version of zmq_poll for our special case
> (single socket, always the same with the same option) ?

poll+recv is always going to be slower than recv alone.

As for the value of the whole thing, the high performance achieved by 
0MQ was *very* costly to implement. Too costly, IMO, to be thrown away 
because of minor implementation problem.

I would suggest starting with the original codebase and simply inserting 
the pieces of the patch enclosed in "if (options.rcvtimeo >= 0) {...}"


More information about the zeromq-dev mailing list