-
Notifications
You must be signed in to change notification settings - Fork 284
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
Dealing with half-opened TCP connections #622
Comments
It always depends, but usually I'd deal with this issue implicitly by implementing a read timeout, either explicitly using Currently there is no (clean) way to enable TCP keep-alive, but I'll add that for the next version. Beware, though, that TCP keep-alives may be unreliable if sent over the internet, so at worst they may have a similar effect as a read timeout. |
But what if I want to wrap connection into some Yes, I know about this issue. Still, TCP keep-alive for next version would be great. |
Using the TCP read timeout will still work for wrapped streams as normal, and for the |
And the last questions: will blocked Does exception on read/write to Stream indicate, that connection is broken? Or should I retry several times before closing it? What is the correct way of ending session?
|
If the connection got terminated due to an unsuccessful write, that should be the case, but I'll have to double check test this to see how libevent behaves in detail. However, actively closing the connection from one task while reading or writing in another is currently not allowed and triggers an assertion (although I don't see a reason why that couldn't be made working, I'll look into that, too).
When |
Thank you very much for help! I will leave this issue open as a feature request for:
|
But what if we call |
Yes killing/interrupting the task would be necessary there, but setting a |
Hello,
I am using connectTCP/listenTCP in my application and currently came across "half open connection problem" (info here: http://blog.stephencleary.com/2009/05/detection-of-half-open-dropped.html): my reading Task never stops if no information is sent(with error) to remote host.
Basically, I want to detect network problems like router reboots or disconnects, and remote system crashes. This can be implemented on application level, but article above suggests that good solution is TCP Keep-Alive.
So, questions here:
Thank you.
The text was updated successfully, but these errors were encountered: