pub struct ConnectionConfig {
pub disconnection_timeout_duration: Duration,
pub heartbeat_interval: Duration,
pub bandwidth_measure_duration: Option<Duration>,
pub bandwidth: BandwidthConfig,
}Expand description
Contains Config properties which will be used by a Server or Client
Fields§
§disconnection_timeout_duration: DurationThe duration to wait for communication from a remote host before initiating a disconnect
heartbeat_interval: DurationThe duration to wait before sending a heartbeat message to a remote host, if the host has not already sent another message within that time
bandwidth_measure_duration: Option<Duration>The duration over which to measure bandwidth. Set to None to avoid
measure bandwidth at all. This is a telemetry/averaging window — NOT
the outbound cap; for that, see bandwidth.
bandwidth: BandwidthConfigOutbound bandwidth budget (token-bucket cap) applied by the unified
priority-sort send loop. Distinct from bandwidth_measure_duration.
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn new(
disconnection_timeout_duration: Duration,
heartbeat_interval: Duration,
bandwidth_measure_duration: Option<Duration>,
) -> Self
pub fn new( disconnection_timeout_duration: Duration, heartbeat_interval: Duration, bandwidth_measure_duration: Option<Duration>, ) -> Self
Creates a new ConnectionConfig, used to initialize a Connection.
Uses default BandwidthConfig; set the .bandwidth field directly
after construction if a non-default budget is required.
Trait Implementations§
Source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
Source§fn clone(&self) -> ConnectionConfig
fn clone(&self) -> ConnectionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more