soe_protocol/constants.rs
1//! Constant values and defaults used by this implementation of the SOE protocol.
2
3use std::time::Duration;
4
5/// The implemented version of the SOE protocol.
6pub const SOE_PROTOCOL_VERSION: u32 = 3;
7
8/// The default number of bytes used to store the CRC check value of a packet.
9pub const CRC_LENGTH: u8 = 2;
10
11/// The default maximum packet (UDP) length.
12pub const DEFAULT_UDP_LENGTH: u32 = 512;
13
14/// The default duration after which to send a heartbeat, if no contextual packets
15/// have been received within the interval.
16pub const DEFAULT_SESSION_HEARTBEAT_AFTER: Duration = Duration::from_secs(25);
17
18/// The default duration after which to consider a session inactive, if no contextual
19/// packets have been received within the interval.
20pub const DEFAULT_SESSION_INACTIVITY_TIMEOUT: Duration = Duration::from_secs(30);
21
22/// The byte sequence that indicates a reliable data packet is carrying bundled
23/// ("multi") data.
24pub const MULTI_DATA_INDICATOR: [u8; 2] = [0x00, 0x19];