Skip to content

Commit

Permalink
Ping works every moment
Browse files Browse the repository at this point in the history
  • Loading branch information
amigin committed Feb 12, 2025
1 parent d43d019 commit 0dca83d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/tcp_gateway/client/gateway_ping_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ pub async fn gateway_ping_loop(gateway_connection: Arc<TcpGatewayConnection>, de
break;
}

if incoming_interval.get_full_seconds() > 3 {
gateway_connection.ping_stop_watch.reset_and_start();
let sent_ok = gateway_connection
.send_payload(&TcpGatewayContract::Ping)
.await;

if !sent_ok {
break;
}
gateway_connection.ping_stop_watch.reset_and_start();
let sent_ok = gateway_connection
.send_payload(&TcpGatewayContract::Ping)
.await;

if !sent_ok {
break;
}
}
}

0 comments on commit 0dca83d

Please sign in to comment.