Send empty message as a keepalive ping

This commit is contained in:
Daniel Sockwell 2020-01-08 10:07:11 -05:00
parent 5b9feda94e
commit a3231d9fdd
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ pub fn send_updates_to_ws(
tx.unbounded_send(msg).expect("No send error");
};
if time.elapsed() > time::Duration::from_secs(30) {
let msg = warp::ws::Message::ping(Vec::new());
let msg = warp::ws::Message::text("{}");
tx.unbounded_send(msg).expect("Can ping");
time = time::Instant::now();
}