Skip to content

Commit 9fed1a9

Browse files
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.
1 parent 51832fb commit 9fed1a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/chat/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
7676
mdns::tokio::Behaviour::new(mdns::Config::default(), key.public().to_peer_id())?;
7777
Ok(MyBehaviour { gossipsub, mdns })
7878
})?
79+
.with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60)))
7980
.build();
8081

8182
// Create a Gossipsub topic

0 commit comments

Comments
 (0)