hopr_transport/
constants.rs

1use std::time::Duration;
2
3/// The maximum waiting time for a message send to produce a half-key challenge reply
4pub const PACKET_QUEUE_TIMEOUT_MILLISECONDS: std::time::Duration = std::time::Duration::from_millis(15000);
5
6/// The maximum queue size for the network update events
7pub(crate) const MAXIMUM_NETWORK_UPDATE_EVENT_QUEUE_SIZE: usize = 4000;
8
9pub(crate) const MAXIMUM_MSG_OUTGOING_BUFFER_SIZE: usize = 20000;
10
11pub const RESERVED_TAG_UPPER_LIMIT: u16 = RESERVED_SESSION_TAG_UPPER_LIMIT;
12
13/// The upper limit value for the session reserved tag range.
14///
15/// The reserved tags are from range <[`RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT`], [`RESERVED_SESSION_TAG_UPPER_LIMIT`]) and are
16/// specifically dedicated for the internal use of the protocol.
17pub(crate) const RESERVED_SESSION_TAG_UPPER_LIMIT: u16 = 1024;
18
19/// The upper limit value for subprotocol reserved tag range.
20///
21/// The reserved tags are from range <0,[`RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT`]) and are
22/// specifically dedicated for the internal use by the subprotocols.
23pub(crate) const RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT: u16 = 16;
24
25/// Time within Start protocol must finish session initiation.
26/// This base value is always multiplied by the (max) number of hops, times 2 (for both-ways).
27pub(crate) const SESSION_INITIATION_TIMEOUT_BASE: Duration = Duration::from_secs(5);