Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct handling of timeout during polling #212

Open
TillAlex opened this issue Dec 1, 2021 · 0 comments
Open

Correct handling of timeout during polling #212

TillAlex opened this issue Dec 1, 2021 · 0 comments

Comments

@TillAlex
Copy link

TillAlex commented Dec 1, 2021

During debugging of the case when timeout elapses while polling I found a strange behaviour:

In

while (!(result = (-1 != zmq.poll(native, 1, timeoutMs))))

the result of zmq_poll is compared to -1. If it's not -1 the method return true. In the case when the timeout elapsed the return value of zmq_poll is 0 and true is returned.

In ZPollItems.Poll

if (PollMany(sockets, items, pollEvents, out error, timeout))

the return value is used to decided if PollManyResults has to be called. But why should we try to read the results if no events have been signaled?

Can anyone have a look into this if the code is working as intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant