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

Use timeout with leastSize on TCPConnection #153

Closed
wants to merge 2 commits into from

Conversation

tchaloupka
Copy link
Contributor

I'm not exactly sure about this, but I guess that if one sets the read timeout on the TCPConnection it should be used in this blocking call too so it won't block forever.

@s-ludwig
Copy link
Member

Agreed about the timeout. It should throw an exception in that case, though, because otherwise leastSize would signal a connection close with 0 bytes returned.

@tchaloupka
Copy link
Contributor Author

I've modified the asyncAwaitAny with timeout parameter to return if Waitable completed in time or not and then used it in waitForData.

Let me know if it's ok this way.

@s-ludwig
Copy link
Member

s-ludwig commented Jun 4, 2019

The main problem is that waitForData may not throw in case of a timeout, I've opened a PR with an alternative implementation that I had lying around for a while: #159 With this, leastSize simply has to enforce(ret != WaitForDataStatus.timeout).

@s-ludwig
Copy link
Member

Okay, #159 is in now.

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

Successfully merging this pull request may close these issues.

2 participants