Skip to content

Commit

Permalink
Flush when sending messages with native client
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Oct 10, 2024
1 parent f396ba0 commit d54b22d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ewebsock/src/native_tungstenite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ pub fn ws_connect_blocking(
WsMessage::Pong(data) => tungstenite::protocol::Message::Pong(data),
WsMessage::Unknown(_) => panic!("You cannot send WsMessage::Unknown"),
};
if let Err(err) = socket.write(outgoing_message) {
if let Err(err) = socket.send(outgoing_message) {
socket.close(None).ok();
socket.flush().ok();
return Err(format!("send: {err}"));
Expand Down

0 comments on commit d54b22d

Please sign in to comment.