#[non_exhaustive]pub struct IoConfig {
pub max_datagram: usize,
pub timeouts: Timeouts,
pub km_refresh_thresholds: KmRefreshThresholds,
}tokio only.Expand description
Timeouts and sizes for the tokio adapter, carried by SrtSocketConfig into
SrtSocket::connect and SrtListener::bind.
Every field has a documented default; use the with_* builders so new
fields can be added without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_datagram: usizeLargest datagram accepted from the network (bytes). Default 1500. A
larger datagram is dropped and counted in SocketStats::rx_oversize
(UDP would otherwise truncate it silently). Values below
MIN_MAX_DATAGRAM are clamped up to it.
timeouts: TimeoutsThe bounds on every awaited I/O: connect (resolving the remote
address and binding the local socket), handshake (the whole caller
handshake), read_idle (longest silence from a connected peer before the
connection is torn down) and write (longest a single send_to may
take). Default SRT_TIMEOUTS.
km_refresh_thresholds: KmRefreshThresholdscrypto only.KM Refresh thresholds (crypto feature / key rotation). Default the
spec-recommended 2^25 / 4000 values. Lower for testing.
Implementations§
Source§impl IoConfig
impl IoConfig
Sourcepub fn with_max_datagram(self, n: usize) -> Self
pub fn with_max_datagram(self, n: usize) -> Self
Set max_datagram, clamped up to MIN_MAX_DATAGRAM.
Sourcepub fn with_timeouts(self, timeouts: Timeouts) -> Self
pub fn with_timeouts(self, timeouts: Timeouts) -> Self
Set timeouts.
Sourcepub fn with_km_refresh_thresholds(self, t: KmRefreshThresholds) -> Self
Available on crate feature crypto only.
pub fn with_km_refresh_thresholds(self, t: KmRefreshThresholds) -> Self
crypto only.Set the KM Refresh thresholds (key rotation packet counts).