pub struct HydraConfig {
pub max_connections: u64,
pub accept_timeout: u64,
pub fixed_packet_length: u64,
pub channel_capacity: u64,
pub observer_token: Option<[u8; 64]>,
pub overflow_mode: ChannelOverflowStrategy,
}Expand description
Configuration for the HydraServer features.
Fields§
§max_connections: u64Maximum number of concurrent connections allowed.
accept_timeout: u64Timeout in milliseconds for accepting new connections when capacity is reached.
fixed_packet_length: u64Fixed length of a single packet/frame in bytes to read/write (excluding AES-GCM overhead).
This length is used to read/write EXACT data from/to the network stream.
channel_capacity: u64Capacity of the internal channel for each session.
observer_token: Option<[u8; 64]>Token for authenticating observer clients for getting ServerMetrics from server ring’s buffer.
overflow_mode: ChannelOverflowStrategyStrategy for handling channel overflow when consumers cannot keep up with producers.
Implementations§
Source§impl HydraConfig
impl HydraConfig
Sourcepub fn config(
max_connections: u64,
accept_timeout: u64,
fixed_packet_length: u64,
channel_capacity: u64,
observer_token: Option<[u8; 64]>,
overflow_mode: ChannelOverflowStrategy,
) -> Self
pub fn config( max_connections: u64, accept_timeout: u64, fixed_packet_length: u64, channel_capacity: u64, observer_token: Option<[u8; 64]>, overflow_mode: ChannelOverflowStrategy, ) -> Self
Creates HydraConfig with the specified parameters.
NOTE:
fixed_packet_lengthis the length of the plaintext data, the actual read/write length will befixed_packet_length + AES-GCM overhead (28 bytes). So this function adds the AES-GCM overhead to thefixed_packet_length(make sure to consider for it, ifHydraConfigis constructed without calling this function).