Skip to content

Commit

Permalink
Updates for latest version of tungstenite
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Dec 19, 2024
1 parent d43059d commit 7857741
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/protocol/src/protocol_transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream<MaybeTlsStream<tokio::n
.ok_or(WsError::ConnectionClosed)?
.map_err(|e| WsError::ConnectionError(e.to_string()))?
{
Ok(msg)
Ok(msg.to_vec())
} else {
Err(WsError::UnexpectedMessageType)
}
}

async fn send(&mut self, msg: Vec<u8>) -> Result<(), WsError> {
SinkExt::send(&mut self, tungstenite::Message::Binary(msg))
SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into()))
.await
.map_err(|_| WsError::ConnectionClosed)
}
Expand All @@ -130,14 +130,14 @@ impl WsConnection for tokio_tungstenite::WebSocketStream<tokio::net::TcpStream>
.ok_or(WsError::ConnectionClosed)?
.map_err(|e| WsError::ConnectionError(e.to_string()))?
{
Ok(msg)
Ok(msg.to_vec())
} else {
Err(WsError::UnexpectedMessageType)
}
}

async fn send(&mut self, msg: Vec<u8>) -> Result<(), WsError> {
SinkExt::send(&mut self, tungstenite::Message::Binary(msg))
SinkExt::send(&mut self, tungstenite::Message::Binary(msg.into()))
.await
.map_err(|_| WsError::ConnectionClosed)
}
Expand Down

0 comments on commit 7857741

Please sign in to comment.