#[non_exhaustive]pub struct SrtSocketConfig {
pub handshake: HandshakeConfig,
pub io: IoConfig,
pub udp: UdpOptions,
pub damage_policy: DamagePolicy,
}tokio only.Expand description
Everything one SRT connection or listener is configured by: the handshake
this side advertises and the adapter’s timeouts and sizes. Every
SrtSocket and SrtListener constructor takes the config:
SrtSocketConfig::new(handshake, io, udp). It is
named for its role, not SrtClientConfig, because one config serves both
the caller (SrtSocket::connect) and the listener (SrtListener::bind).
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.handshake: HandshakeConfigThe handshake values this side advertises.
io: IoConfigThe tokio adapter’s timeouts and sizes.
udp: UdpOptionsThe socket options every socket this config binds is created with
(SO_RCVBUF, address and port reuse, a multicast join). Required: the
library chooses none. UdpOptions::new is the explicit “leave every
option at the system’s value”; a link at broadcast bitrates needs a
receive buffer sized for the longest burst the application can be late
by (see the crate docs). Not applied to a socket the caller built and
hands to SrtSocket::connect_from_socket,
SrtSocket::rendezvous_from_socket: that socket keeps the options the
caller gave it.
damage_policy: DamagePolicyWhat each damage report means for this connection: Report (the
default for everything) publishes it as SrtEvent::Damage and keeps
delivering; Fail ends the connection with Error::Damage
carrying the same report.
Implementations§
Source§impl SrtSocketConfig
impl SrtSocketConfig
Sourcepub fn new(handshake: HandshakeConfig, io: IoConfig, udp: UdpOptions) -> Self
pub fn new(handshake: HandshakeConfig, io: IoConfig, udp: UdpOptions) -> Self
A config with handshake, the caller’s IoConfig and the socket
options udp for every socket it binds.
Sourcepub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
pub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
Set what each damage report means (see SrtSocketConfig::damage_policy).
Sourcepub fn with_handshake(self, handshake: HandshakeConfig) -> Self
pub fn with_handshake(self, handshake: HandshakeConfig) -> Self
Replace SrtSocketConfig::handshake.
Sourcepub fn with_udp(self, udp: UdpOptions) -> Self
pub fn with_udp(self, udp: UdpOptions) -> Self
Replace SrtSocketConfig::udp.
Sourcepub fn with_io(self, io: IoConfig) -> Self
pub fn with_io(self, io: IoConfig) -> Self
Replace SrtSocketConfig::io.