Skip to content

Commit c85c7cc

Browse files
committed
Add a kad SUBSTREAM_TIMEOUT constant
1 parent 04c2e64 commit c85c7cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

protocols/kad/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use std::time::Duration;
4141
use std::{error, fmt, io, marker::PhantomData, pin::Pin, task::Context, task::Poll};
4242

4343
const MAX_NUM_STREAMS: usize = 32;
44+
const SUBSTREAM_TIMEOUT: Duration = Duration::from_secs(10);
4445

4546
/// Protocol handler that manages substreams for the Kademlia protocol
4647
/// on a single connection with a peer.
@@ -455,7 +456,7 @@ impl Handler {
455456
next_connec_unique_id: UniqueConnecId(0),
456457
inbound_substreams: Default::default(),
457458
outbound_substreams: futures_bounded::FuturesTupleSet::new(
458-
Duration::from_secs(10),
459+
SUBSTREAM_TIMEOUT,
459460
MAX_NUM_STREAMS,
460461
),
461462
pending_streams: Default::default(),

0 commit comments

Comments
 (0)