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 and ratatui_*, this leads to leaks in the form of Arc<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 the Server::Handler instance in order to handle cleanup, for example.
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.