Respond to WebSocket ping messages with a pong message
This commit is contained in:
parent
2ceb10f4cb
commit
c098fe3380
1 changed files with 3 additions and 0 deletions
|
@ -102,6 +102,9 @@ impl Rpc {
|
|||
match msg {
|
||||
// We've received a message from the client
|
||||
Ok(msg) => {
|
||||
if msg.is_ping() {
|
||||
let _ = chn.send(Message::pong(vec![]));
|
||||
}
|
||||
if msg.is_text() {
|
||||
tokio::task::spawn(Rpc::call(rpc.clone(), msg, chn.clone()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue