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:
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user