-
Notifications
You must be signed in to change notification settings - Fork 223
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
async client stream does not know when a connection closes #136
Comments
It looks like the problem may be a more fundamental Tokio issue: tokio-rs/tokio-core#192 |
this is very strange, the async stuff is just a wrapper around a raw |
I solved the problem. The issue is in the async-client example, not in the websocket crate itself. The example uses However, the I fixed the problem by replacing the built-in select with my own combinator, |
@alex-shapiro thanks for the fix, I'm re-opening so I can fix the example. I think it could be fixed without a new combinator and selecting over |
@illegalprime I meet the same issue when tcp is closed by peer. There is a way to reproduce this issue:
Have any idea to handle this issue? Thank you very much. |
A non-websocket-related answer: There's rather radical way: clone the underlying TCP socket and use the cloned sibling specifically for detecting connection reset. Relevant Tokio issue: tokio-rs/tokio#483 |
Thanks for reply. This is an amazing progress, however I can't get |
Problem: When a connection closes abnormally, the client stream does not return or acknowledge the broken connection.
Desired Behavior: When a connection closes abnormally, the client stream resolves immediately.
Quick demo of the problem, using the
async-client
+async-server
examples:The client stream remains open and shows no sign that the connection has closed. If the user sends a message via stdin_ch, the client accepts the message. If you send a second message, the client finally panics with a
Broken Pipe
IO error.The text was updated successfully, but these errors were encountered: