-
Notifications
You must be signed in to change notification settings - Fork 43
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
How to detect disconnection? #99
Comments
Hi @dizda, Sorry for the late response. Detecting disconnects via YamuxAs far as I can tell, this Yamux implementation does not allow actively sending Yamux Pings, though it is able to answer them. Actively sending Yamux Ping messages could be used to detect disconnects. Detecting disconnects via TCPI would expect your operating system's TCP/IP stack to eventually detect the disconnect through the various keep-alive mechanisms, thus closing the socket. Upon closing of the socket, Yamux should notice the failure, thus closing all substreams. In case option two does not work for you, would you mind (1) describing your issue in greater depth and possibly (2) providing a way for us to reproduce the issue? |
Hi @mxinden, I'm interested in keeping alive connection as long as possible, and I try to evaluate whether I can use this Yamux implementation for the client.
Does it mean it is an architectural decision and there are no plans to allow it? Or simply because lib-p2p did not need this feature therefore it's left for some brave contributor to fill this gap? In the latter case, I guess one should make a change in |
👍 we sure do need more brave contributors. Before you start, would you mind detailing your use-case for Yamux ping messages? More concretely what are you trying to solve that you can not already solve on the transport level (e.g. via the TCP keep alive mechanism)? |
In Go's version, it has a config field |
Dear all,
I initialize a connection between my local (client) to a remote server (server) using yamux.
Then I switch my computer's connection off, and my local client remain connected forever while yamux or TcpStream should have triggered a disconnection.
How could I solve that?
Shouldn't yamux be capable of detecting that?
It would be better to detect without sending any data, cf. tokio-rs/tokio#2228
The text was updated successfully, but these errors were encountered: