pub struct ServerConfig {Show 14 fields
pub protocol: u32,
pub max_connections: usize,
pub max_per_ip: usize,
pub max_payload: usize,
pub max_stream_payload: usize,
pub timeout_ms: u32,
pub keepalive_ms: u32,
pub packets_per_s: u32,
pub bytes_per_s: u32,
pub challenges_per_s: u32,
pub handshake_ms: u32,
pub max_message: usize,
pub max_reliable_queued: usize,
pub reliable_bytes_per_s: u32,
}Expand description
a server’s limits and timing
Fields§
§protocol: u32the app’s protocol id: clients with another one are refused (another game, another version)
max_connections: usizeconnections at once (UDP and WebSocket together)
max_per_ip: usizeconnections from one IP address
max_payload: usizethe largest payload of a UDP message, both ways (at most MAX_UDP_PAYLOAD)
max_stream_payload: usizethe largest payload of a message over a WebSocket, both ways
timeout_ms: u32nothing received for this long ends a connection
keepalive_ms: u32an empty DATA packet after this long without sending (carries the acks)
packets_per_s: u32packets a second from one client (UDP: more are dropped; WebSocket: it is disconnected)
bytes_per_s: u32bytes a second from one client (as packets_per_s)
challenges_per_s: u32handshakes a second whose keys the server works out (two or three X25519 each), for all addresses together; one address prefix (IPv4 /24, IPv6 /48) gets a sixteenth of it. Counted after the cookie checked, so a forged sender costs nothing of it; CONNECTs are answered without it (a HMAC, and less goes back than came: a flood of them throttled new players)
handshake_ms: u32a WebSocket must send its CONNECT within this long
max_message: usizethe largest message of the reliable channel, both ways (a client’s larger one ends its connection)
max_reliable_queued: usizebytes of reliable messages queued for one client before send_reliable says Backlog
reliable_bytes_per_s: u32bytes a second of reliable chunks to one client (below what its bytes_per_s takes)