mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: don't handle connection closed same as other errors
This commit is contained in:
parent
ae92785484
commit
572aa632b6
2 changed files with 9 additions and 5 deletions
|
|
@ -182,7 +182,12 @@ pub fn run_handshakes_and_read_messages(
|
|||
},
|
||||
Err(Io(err)) if err.kind() == ErrorKind::WouldBlock => {
|
||||
break;
|
||||
}
|
||||
},
|
||||
Err(tungstenite::Error::ConnectionClosed) => {
|
||||
remove_connection_if_exists(connections, poll_token);
|
||||
|
||||
break
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!("error reading messages: {}", err);
|
||||
|
||||
|
|
@ -229,8 +234,9 @@ pub fn send_out_messages(
|
|||
|
||||
match established_ws.ws.write_message(out_message.to_ws_message()){
|
||||
Ok(()) => {},
|
||||
Err(Io(err)) if err.kind() == ErrorKind::WouldBlock => {
|
||||
continue;
|
||||
Err(Io(err)) if err.kind() == ErrorKind::WouldBlock => {},
|
||||
Err(tungstenite::Error::ConnectionClosed) => {
|
||||
remove_connection_if_exists(connections, meta.poll_token);
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!("error writing ws message: {}", err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue