-
Notifications
You must be signed in to change notification settings - Fork 25
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
Receiver: return after timeout even if more data is pending #218
Conversation
@@ -2,6 +2,8 @@ | |||
|
|||
# git master | |||
|
|||
* [218](https://github.com/HBPVIS/ZeroEQ/pull/218): | |||
Fix infinite loop in slow receivers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more like "with very fast sender(s)"
const uint32_t remaining = | ||
duration_cast<milliseconds>(high_resolution_clock::now() - | ||
startTime) | ||
.count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice formatting :)
@eile @tribal-tec this commit breaks the http server in Tide, which is based on QSocketNotifier. I don't understand what you were trying to achieve here. Doing a non-blocking receive() using timeout=0 is not allowed anymore? Please advise. |
Seems there is no test for this. :P This PR fixed that if the publisher is faster than the subscriber, a subscriber.receive(timeout) would never return, even after the timeout expired. This changes the behaviour of receive(0) which now will do one receive, not all (which is in line with the doc/spec). Not sure why/how this breaks the QSocketNotifier. |
OK, part of the problem is that the timeout is now used for two purposes:
I think the reason it breaks in Tide is because the zmq socket notifies only once data first arrives (edge triggered), not as long as there is data to read (level triggered). So now it only processes one message, exceeds the limit of 0 millisecond and stops instead of reading all messages. |
Wouldn't |
seeing that receive() returns false when no messages were processed probably yes, I will test that next week |
No description provided.