pub struct WsConfig {
pub port: u16,
pub ping_interval: Duration,
pub pong_timeout: Duration,
pub max_message_size: usize,
pub max_pending_handshakes: usize,
pub handshake_timeout: Duration,
}Expand description
Configuration for WebSocket transport.
Fields§
§port: u16Port to listen on for incoming WebSocket connections.
ping_interval: DurationInterval between ping frames sent to the peer.
pong_timeout: DurationMaximum time to wait for a pong response before considering the connection dead.
max_message_size: usizeMaximum WebSocket message size in bytes.
max_pending_handshakes: usizeMaximum number of concurrent in-flight incoming handshakes (WS upgrade + hello exchange). Connections beyond the cap are dropped before the upgrade; established connections are not counted.
handshake_timeout: DurationMaximum time an incoming connection may take to complete the WS upgrade + hello exchange before it is dropped. Must exceed HELLO_TIMEOUT (5s) so hello timeouts keep their specific classification.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsConfig
impl RefUnwindSafe for WsConfig
impl Send for WsConfig
impl Sync for WsConfig
impl Unpin for WsConfig
impl UnsafeUnpin for WsConfig
impl UnwindSafe for WsConfig
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