hopr_transport/
constants.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use std::time::Duration;

/// The maximum waiting time for a message send to produce a half-key challenge reply
pub const PACKET_QUEUE_TIMEOUT_MILLISECONDS: std::time::Duration = std::time::Duration::from_millis(15000);

/// The maximum queue size for the network update events
pub(crate) const MAXIMUM_NETWORK_UPDATE_EVENT_QUEUE_SIZE: usize = 4000;

pub(crate) const MAXIMUM_MSG_INCOMING_BUFFER_SIZE: usize = 20000;
pub(crate) const MAXIMUM_MSG_OUTGOING_BUFFER_SIZE: usize = 20000;
pub(crate) const MAXIMUM_ACK_INCOMING_BUFFER_SIZE: usize = 20000;

pub const RESERVED_TAG_UPPER_LIMIT: u16 = RESERVED_SESSION_TAG_UPPER_LIMIT;

/// The upper limit value for the session reserved tag range.
///
/// The reserved tags are from range <[`RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT`], [`RESERVED_SESSION_TAG_UPPER_LIMIT`]) and are
/// specifically dedicated for the internal use of the protocol.
pub(crate) const RESERVED_SESSION_TAG_UPPER_LIMIT: u16 = 1024;

/// The upper limit value for subprotocol reserved tag range.
///
/// The reserved tags are from range <0,[`RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT`]) and are
/// specifically dedicated for the internal use by the subprotocols.
pub(crate) const RESERVED_SUBPROTOCOL_TAG_UPPER_LIMIT: u16 = 16;

/// Time within Start protocol must finish session initiation.
/// This base value is always multiplied by the (max) number of hops, times 2 (for both-ways).
pub(crate) const SESSION_INITIATION_TIMEOUT_BASE: Duration = Duration::from_secs(5);