1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

keep-alive support

This commit is contained in:
Nikolay Kim
2017-10-13 16:33:23 -07:00
parent 0447c66de1
commit 3516f02e4f
11 changed files with 264 additions and 88 deletions

View File

@ -84,6 +84,9 @@ impl Handler<ws::Message> for MyWS {
ws::Message::Ping(msg) => ws::WsWriter::pong(ctx, msg),
ws::Message::Text(text) => ws::WsWriter::text(ctx, text),
ws::Message::Binary(bin) => ws::WsWriter::binary(ctx, bin),
ws::Message::Closed | ws::Message::Error => {
ctx.stop();
}
_ => (),
}
Self::empty()