pub struct HydraConfig {
pub max_connections: u64,
pub accept_timeout: u64,
pub fixed_packet_length: u64,
pub channel_capacity: u64,
pub overflow_mode: ChannelOverflowStrategy,
/* private fields */
}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.
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,
overflow_mode: ChannelOverflowStrategy,
) -> Self
pub fn config( max_connections: u64, accept_timeout: u64, fixed_packet_length: u64, channel_capacity: u64, 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).