fix(event loop): disconnect client whenever it has any error
This commit is contained in:
@@ -65,12 +65,11 @@ impl EventLoop {
|
|||||||
match clients.get(token.0).unwrap().as_ref().unwrap().dispatch() {
|
match clients.get(token.0).unwrap().as_ref().unwrap().dispatch() {
|
||||||
Ok(_) => continue,
|
Ok(_) => continue,
|
||||||
Err(e) => match e.kind() {
|
Err(e) => match e.kind() {
|
||||||
std::io::ErrorKind::UnexpectedEof => {
|
std::io::ErrorKind::WouldBlock => break,
|
||||||
|
_ => {
|
||||||
clients.remove(token.0);
|
clients.remove(token.0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
std::io::ErrorKind::WouldBlock => break,
|
|
||||||
_ => return Err(e.into()),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user