[zeromq-dev] feeback on new poller API

brunobodin . brunobodin at gmail.com
Mon Mar 13 13:44:34 CET 2017


You're right, testing on ETIMEDOUT is fine :

 if( zmq_poller_wait(poller, &evt, timeout)<0 && zmq_errno()!=ETIMEDOUT )
        throw std::runtime_error( "polling error");

works in my case where I do not want to catch time out.

Thanks Doron, finally I do not think there is a need for api change.

Bruno

On Mon, Mar 13, 2017 at 11:24 AM, Doron Somech <somdoron at gmail.com> wrote:

> When timeout elapsed the errno should be ETIMEDOUT.
>
> I think it is a consistent behavior across C, but I'm actually not sure.
>
> Maybe we can change the behavior for wait_all and leave the wait as is.
>
> It is still draft but I think the change can upset too many people.
>
>
> On Mar 13, 2017 11:41 AM, "brunobodin ." <brunobodin at gmail.com> wrote:
>
>> Hi
>>
>> following discussion about migration from 4.1.2 to 4.2.2, I moved my code
>> to the new polling API.
>>
>> I have a question about zmq_poller_wait : when I call it with a timeout
>> of 0, the outcome can be that
>> no socket is ready (which is possible in my design), but in that case,
>> zmq_poller_wait return  -1
>>
>> I think we should be able to distinguish between an error during the call
>> and the case where
>> there is no socket ready ?
>> so maybe returnd code shoud be -1 on error, 0 when there is no event, 1
>> otherwise ?
>>
>> Bruno
>>
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170313/e84f3c19/attachment.htm>


More information about the zeromq-dev mailing list