1
0
mirror of https://github.com/actix/examples synced 2025-06-29 02:10:36 +02:00

Implement websocket heartbeats (#48)

This commit is contained in:
sapir
2018-09-27 22:37:19 +03:00
committed by Douman
parent d9afae21b6
commit 87f89b54f0
5 changed files with 120 additions and 21 deletions

View File

@ -97,6 +97,9 @@ impl ChatClient {
ctx.run_later(Duration::new(1, 0), |act, ctx| {
act.framed.write(codec::ChatRequest::Ping);
act.hb(ctx);
// client should also check for a timeout here, similar to the
// server code
});
}
}