Skip to content
Snippets Groups Projects
Unverified Commit a07fb323 authored by Alexandru Vasile's avatar Alexandru Vasile
Browse files

litep2p: Increase keep-alive to 10 seconds to mirror libp2p


Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent 31abe611
No related merge requests found
Pipeline #514427 canceled with stages
......@@ -100,6 +100,9 @@ mod peerstore;
mod service;
mod shim;
/// Timeout for connection waiting new substreams.
const KEEP_ALIVE_TIMEOUT: Duration = Duration::from_secs(10);
/// Litep2p bandwidth sink.
struct Litep2pBandwidthSink {
sink: litep2p::BandwidthSink,
......@@ -566,6 +569,9 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
.with_connection_limits(ConnectionLimitsConfig::default().max_incoming_connections(
Some(crate::MAX_CONNECTIONS_ESTABLISHED_INCOMING as usize),
))
// This has the same effect as `libp2p::Swarm::with_idle_connection_timeout` which is
// set to 10 seconds as well.
.with_keep_alive_timeout(KEEP_ALIVE_TIMEOUT)
.with_executor(executor);
if let Some(config) = maybe_mdns_config {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment