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

Martin Sustrik sustrik at 250bpm.com
Sun Jun 12 09:35:54 CEST 2011


On 06/12/2011 01:53 AM, Fabien Niñoles wrote:
> OK, I add a test for this condition, find a bug in my previous code
> and fix this.  Nothing better than a test to check your work :)
>
> Here the new patch.

Great!

Now for the performance stuff. Can you fall back to the old wait 
mechanism (simple blocking recv call) in case the timout is infinite. 
The point being that calling recv is much faster than calling zmq_poll 
followed by recv.

That way there would be no performance regression for those using the 
API in the old way and thus we can merge the patch in straight away.

The new way (RCVTIMEO/SNDTIMEO) will be somehow slower but we can fix 
that later on.

Martin



More information about the zeromq-dev mailing list