-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Handle client disconnections #373
Comments
fwiw, I'm using |
Correct - simply do your cleanup in |
EpicEric
added a commit
to EpicEric/russh
that referenced
this issue
Nov 14, 2024
In Eugeny#373 I raised my confusion about the lack of a disconnection mechanism in the source code and the examples, but it was pointed out that `Drop` is the intended way of cleaning up resources. This PR adds a Drop implementation for three of the server examples, so that users that refer to these won't be confused about how to implement their own cleanup.
Eugeny
pushed a commit
that referenced
this issue
Nov 14, 2024
In #373 I raised my confusion about the lack of a disconnection mechanism in the source code and the examples, but it was pointed out that `Drop` is the intended way of cleaning up resources. This PR adds a Drop implementation for three of the server examples, so that users that refer to these won't be confused about how to implement their own cleanup.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, there's only handling for sessions errors - and even in this case, there's no way to refer to the handler itself, only to the error. In cases like the library-provided examples
echoserver
andratatui_*
, this leads to leaks in the form ofArc<Mutex<HashMap<...>>>
entries, which is troublesome for any real application.From what I've managed to hunt in the source code so far, it only seems to log the disconnection without doing much else. Ideally, there should be a
client_disconnected
callback that takes theServer::Handler
instance in order to handle cleanup, for example.The text was updated successfully, but these errors were encountered: