[zeromq-dev] [PATCH] Add ZMQ_RCVTIMEO/SNDTIMEO sockopt [was: [PATCH] Add ZMQ_TIMEOUT sockopt]

Fabien Niñoles fabien.ninoles at gmail.com
Mon Jun 6 01:04:38 CEST 2011

And another update where I removed the block parameter; This way,
setting the timeout value to 0 would behave always like a non-blocking
call (I hesitate to do it first but can't see why it shouldn't be


2011/6/5 Fabien Niñoles <fabien.ninoles at gmail.com>:
> Sorry, I forget to update my patch file, here the good one.
> 2011/6/5 Fabien Niñoles <fabien.ninoles at gmail.com>:
>> Sorry for the long time before sending back a new patch, but here it
>> is. The basic changes are I rename ZMQ_TIMEOUT to ZMQ_RCVTIMEO and
>> ZMQ_SNDTIMEO and I used polling instead of a busy loop in the
>> mailbox_t::recv method.  Two things I'm not sure:
>> - I use zmq_poll since it abstracts nicely the different poll
>> implementation but this is an external API and it is usually bad
>> practices to do it so.   It's probably far worse to duplicate such
>> complex piece of code, so I kept it this way unless you tell me
>> otherwise.
>> - The windows version of mailbox_t::recv only differ in the error
>> handling (wsa_assert/SOCKET_ERROR instead of errno_assert/-1) and I
>> merged them for this reason. Shouldn't we have an abstraction for this
>> instead of the ugly ZMQ_HAS_WINDOWS #ifdef ?
>> Thanks,
>> Fabien
>> 2011/5/23 Fabien Niñoles <fabien.ninoles at gmail.com>:
>>> OK, I would go with a little more specs here, to be more in line with
>>> the normal socket behavior.
>>> - Value is an uint32 in ms (to be compatible with windows and kept the
>>> implementation simple).
>>> - Default to 0, which would mean block infinitely.
>>> - On timeout, return EAGAIN.
>>> Everything's ok with you ?
>>> Fabien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-sockopt-ZMQ_RCVTIMEO-ZMQ_SNDTIMEO.patch
Type: text/x-patch
Size: 22544 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110605/e84cf14f/attachment.bin>

More information about the zeromq-dev mailing list