fix(event loop): disconnect client whenever it has any error

This commit is contained in:
Nova
2022-07-11 20:17:24 -04:00
parent 634d49c077
commit 6f9e518243

View File

@@ -65,12 +65,11 @@ impl EventLoop {
match clients.get(token.0).unwrap().as_ref().unwrap().dispatch() {
Ok(_) => continue,
Err(e) => match e.kind() {
std::io::ErrorKind::UnexpectedEof => {
std::io::ErrorKind::WouldBlock => break,
_ => {
clients.remove(token.0);
break;
}
std::io::ErrorKind::WouldBlock => break,
_ => return Err(e.into()),
},
}
},