Skip to content

Commit

Permalink
fix(chat-example): set idle_connection_timeout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thomaseizinger authored Nov 13, 2023
1 parent 51832fb commit 9fed1a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/chat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
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
Expand Down

0 comments on commit 9fed1a9

Please sign in to comment.