pub struct ServerConfig {
pub bind_addr: String,
pub max_clients: usize,
pub max_payload: usize,
pub idle_timeout: Duration,
pub ping_interval: Duration,
pub channel_capacity: usize,
}Expand description
Server configuration.
Fields§
§bind_addr: String§max_clients: usize§max_payload: usize§idle_timeout: DurationMax time without receiving any frame from a client.
This is a raw read inactivity timeout: if the server gets nothing for
this duration, the client is disconnected with SyncError::IdleTimeout.
Pong responses to server pings count as activity and reset this timer.
See also: ping_interval for protocol-level
liveness (server sends Ping, expects Pong before next tick).
ping_interval: DurationHow often the server sends Ping to clients. The pong deadline is one
full ping_interval — if no Pong arrives before the next tick, the
client is disconnected with SyncError::PingTimeout.
channel_capacity: usizePer-client write channel capacity. Frames are dropped when the channel
is full (with on_backpressure hook). Higher values buffer more for
bursty games; lower values keep latency tight.
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