mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
send the correct exit code when closing the websocket (#335)
Signed-off-by: Bart Willems <bwillems@protonmail.com>
This commit is contained in:
@ -25,6 +25,10 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WebSocket {
|
||||
ws::Message::Text(text) => ctx.text(text),
|
||||
ws::Message::Binary(bin) => ctx.binary(bin),
|
||||
ws::Message::Ping(bytes) => ctx.pong(&bytes),
|
||||
ws::Message::Close(reason) => {
|
||||
ctx.close(reason);
|
||||
ctx.stop();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user