pub struct ClientConfig {
pub protocol: u32,
pub max_payload: usize,
pub timeout_ms: u32,
pub keepalive_ms: u32,
pub connect_ms: u32,
pub resend_ms: u32,
pub packets_per_s: u32,
pub bytes_per_s: u32,
pub server_key: Option<[u8; 32]>,
pub max_message: usize,
pub max_reliable_queued: usize,
pub reliable_bytes_per_s: u32,
}Expand description
a client’s limits and timing
Fields§
§protocol: u32the app’s protocol id (the server’s must be the same)
max_payload: usizethe largest payload this side takes from the server (UDP at most MAX_UDP_PAYLOAD); the handshake tells the server, which sends no more
timeout_ms: u32nothing received for this long ends the connection
keepalive_ms: u32an empty DATA packet after this long without sending
connect_ms: u32the handshake within this long
resend_ms: u32UDP: CONNECT / RESPONSE again after this long without an answer
packets_per_s: u32packets a second from the server, on average (more are dropped)
bytes_per_s: u32bytes a second from the server, on average (more are dropped)
server_key: Option<[u8; 32]>UDP: the server’s static public key (ServerCore::set_static_key, Server::set_static_key). Given, the keys need the server’s secret, and a server without it is refused (Reason::ServerKey); None: ephemeral keys only, safe from listeners but not from someone on the path who answers in the server’s place
max_message: usizethe largest message of the reliable channel, both ways (the server’s larger one ends the connection)
max_reliable_queued: usizebytes of reliable messages queued before send_reliable says Backlog
reliable_bytes_per_s: u32bytes a second of reliable chunks to the server (below its bytes_per_s)