Fixed pinging

This commit is contained in:
2026-02-18 22:55:58 +01:00
parent 5edbe8c8a1
commit a14a989691
3 changed files with 6 additions and 14 deletions
+3 -2
View File
@@ -102,12 +102,13 @@ impl Session {
self.send_frame(0x8, &[]).await
}
pub fn start_ping(self: Arc<Self>) {
pub fn start_ping_loop(&self) {
let s = self.clone();
tokio::task::spawn(async move {
let mut interval = tokio::time::interval(std::time::Duration::from_secs(15));
loop {
interval.tick().await;
if self.send_ping().await.is_err() {
if s.send_ping().await.is_err() {
break;
}
}