pub struct ServerConfig {Show 17 fields
pub bind_addr: SocketAddr,
pub max_connections: usize,
pub chunk_size: u32,
pub window_ack_size: u32,
pub peer_bandwidth: u32,
pub connection_timeout: Duration,
pub idle_timeout: Duration,
pub tcp_nodelay: bool,
pub tcp_recv_buffer: usize,
pub tcp_send_buffer: usize,
pub read_buffer_size: usize,
pub write_buffer_size: usize,
pub gop_buffer_enabled: bool,
pub gop_buffer_max_size: usize,
pub stats_interval: Duration,
pub enhanced_rtmp: EnhancedRtmpMode,
pub enhanced_capabilities: EnhancedServerCapabilities,
}Expand description
Server configuration options
Fields§
§bind_addr: SocketAddrAddress to bind to
max_connections: usizeMaximum concurrent connections (0 = unlimited)
chunk_size: u32Chunk size to negotiate with clients
window_ack_size: u32Window acknowledgement size
peer_bandwidth: u32Peer bandwidth limit
connection_timeout: DurationConnection timeout (handshake must complete within this time)
idle_timeout: DurationIdle timeout (disconnect if no data received)
tcp_nodelay: boolEnable TCP_NODELAY (disable Nagle’s algorithm)
tcp_recv_buffer: usizeTCP receive buffer size (0 = OS default)
tcp_send_buffer: usizeTCP send buffer size (0 = OS default)
read_buffer_size: usizeApplication-level read buffer size
write_buffer_size: usizeApplication-level write buffer size
gop_buffer_enabled: boolEnable GOP buffering for late-joiner support
gop_buffer_max_size: usizeMaximum GOP buffer size in bytes
stats_interval: DurationStats update interval
enhanced_rtmp: EnhancedRtmpModeEnhanced RTMP mode (Auto, LegacyOnly, or EnhancedOnly)
enhanced_capabilities: EnhancedServerCapabilitiesEnhanced RTMP server capabilities to advertise
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn with_addr(addr: SocketAddr) -> Self
pub fn with_addr(addr: SocketAddr) -> Self
Create a new config with custom bind address
Sourcepub fn bind(self, addr: SocketAddr) -> Self
pub fn bind(self, addr: SocketAddr) -> Self
Set the bind address
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Set maximum connections
Sourcepub fn chunk_size(self, size: u32) -> Self
pub fn chunk_size(self, size: u32) -> Self
Set chunk size
Sourcepub fn disable_gop_buffer(self) -> Self
pub fn disable_gop_buffer(self) -> Self
Disable GOP buffering
Sourcepub fn connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set idle timeout
Sourcepub fn enhanced_rtmp(self, mode: EnhancedRtmpMode) -> Self
pub fn enhanced_rtmp(self, mode: EnhancedRtmpMode) -> Self
Set Enhanced RTMP mode.
Auto: Negotiate E-RTMP if client supports it (default)LegacyOnly: Use legacy RTMP onlyEnhancedOnly: Require E-RTMP, reject legacy clients
Sourcepub fn enhanced_capabilities(self, caps: EnhancedServerCapabilities) -> Self
pub fn enhanced_capabilities(self, caps: EnhancedServerCapabilities) -> Self
Set Enhanced RTMP server capabilities.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more