Skip to content

Commit 6c03522

Browse files
set keep alive and idle timeouts for new paths
1 parent a1a5723 commit 6c03522

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

iroh/src/magicsock.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,20 @@ impl MagicSock {
446446
let conn = conn.clone();
447447
let addr = *addr;
448448
task::spawn(async move {
449-
if let Err(err) = conn
449+
match conn
450450
.open_path(addr, quinn_proto::PathStatus::Available)
451451
.await
452452
{
453-
warn!("failed to open path {:?}", err);
453+
Ok(path) => {
454+
path.set_max_idle_timeout(Some(
455+
ENDPOINTS_FRESH_ENOUGH_DURATION,
456+
))
457+
.ok();
458+
path.set_keep_alive_interval(Some(HEARTBEAT_INTERVAL)).ok();
459+
}
460+
Err(err) => {
461+
warn!("failed to open path {:?}", err);
462+
}
454463
}
455464
});
456465
}

0 commit comments

Comments
 (0)