#[non_exhaustive]pub struct IoConfig {
pub max_datagram: usize,
pub connect: Duration,
pub handshake: Duration,
pub read_idle: Duration,
pub write: Duration,
}tokio only.Expand description
Timeouts and sizes for the tokio adapter (SrtSocket::connect_with,
SrtListener::bind_with).
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.
connect: DurationBound on resolving the remote address and binding the local socket. Default 10 s.
handshake: DurationBudget for the whole caller handshake. Default 5 s (the previous
HANDSHAKE_TIMEOUT constant).
read_idle: DurationLongest silence from a connected peer before the connection is torn
down. Default 5 s: libsrt’s SRTO_PEERIDLETIMEO default of 5000 ms (the
previous PEER_IDLE_TIMEOUT constant).
write: DurationLongest a single send_to may take. Default 5 s.
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_connect(self, d: Duration) -> Self
pub fn with_connect(self, d: Duration) -> Self
Set connect.
Sourcepub fn with_handshake(self, d: Duration) -> Self
pub fn with_handshake(self, d: Duration) -> Self
Set handshake.
Sourcepub fn with_read_idle(self, d: Duration) -> Self
pub fn with_read_idle(self, d: Duration) -> Self
Set read_idle.
Sourcepub fn with_write(self, d: Duration) -> Self
pub fn with_write(self, d: Duration) -> Self
Set write.