This commit is contained in:
Aiden McClelland
2021-11-24 12:45:32 -07:00
committed by Aiden McClelland
parent 2aa9b35e08
commit 9f1d140911

View File

@@ -143,7 +143,14 @@ async fn deal_with_messages(
.with_kind(crate::ErrorKind::Network)?;
}
message = stream.next().fuse() => {
match message.transpose().with_kind(crate::ErrorKind::Network)? {
let message = match message.transpose() {
Err(tokio_tungstenite::tungstenite::Error::ConnectionClosed) => {
tracing::info!("Closing WebSocket: Reason: {}", tokio_tungstenite::tungstenite::Error::ConnectionClosed);
return Ok(())
}
a => a,
}.with_kind(crate::ErrorKind::Network)?;
match message {
Some(Message::Ping(a)) => {
stream
.send(Message::Pong(a))