Skip to content

Commit

Permalink
fix: speed up time to go online;
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr.Panda committed Dec 27, 2023
1 parent 2632b28 commit 40054ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions turn-balance/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ async fn main() -> anyhow::Result<()> {
.encode(&mut ping_buf);

loop {
// Sent every 10 seconds, too many packets can cause unnecessary overhead by the
// parent.
sleep(Duration::from_secs(10)).await;
if let Err(e) = socket.send_to(&ping_buf, superiors).await {
if e.kind() != ConnectionReset {
break;
}
}

// Sent every 10 seconds, too many packets can cause unnecessary overhead by the
// parent.
sleep(Duration::from_secs(10)).await;
}
} else {
std::future::pending::<()>().await;
Expand Down

0 comments on commit 40054ae

Please sign in to comment.