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

Connection Broken Pipe Issue #81

Closed
zwx14700 opened this issue Apr 7, 2020 · 0 comments
Closed

Connection Broken Pipe Issue #81

zwx14700 opened this issue Apr 7, 2020 · 0 comments
Assignees
Milestone

Comments

@zwx14700
Copy link
Contributor

zwx14700 commented Apr 7, 2020

Problem description
Currently, the connection_pool doesn't have the mechanism to check whether the connection is closed by the server, which would let write/read have a broken pipe issue.

Problem location
ConnectionPool.

Suggestions for an improvement
There are many discussion in the Tokio repo, and Tokio doesn't have an easy way to check the TCPStream is closed.
websockets-rs/rust-websocket#136
tokio-rs/tokio#483
tokio-rs/tokio#2228

Currently, we can use https://docs.rs/tokio/0.2.16/tokio/net/struct.TcpStream.html#method.poll_peek
to resolve this issue.
If the poll_peek returns 0, that means the socket is closed by the server.

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