From 9fed1a9e73e81f3d1a292ec35a230d19387a384d Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 13 Nov 2023 11:36:24 +1100 Subject: [PATCH] fix(chat-example): set `idle_connection_timeout` This one seems to have fallen through the cracks somehow. Without setting an idle connection timeout, the connection is immediately closed. Related: #4837. Pull-Request: #4840. --- examples/chat/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/chat/src/main.rs b/examples/chat/src/main.rs index 24f8b19d0c4..c785d301c2f 100644 --- a/examples/chat/src/main.rs +++ b/examples/chat/src/main.rs @@ -76,6 +76,7 @@ async fn main() -> Result<(), Box> { mdns::tokio::Behaviour::new(mdns::Config::default(), key.public().to_peer_id())?; Ok(MyBehaviour { gossipsub, mdns }) })? + .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) .build(); // Create a Gossipsub topic