pub struct ServerConfig {Show 15 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,
}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
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
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more