pub struct HostOptions { /* private fields */ }Expand description
Host-side transport options, passed to host_with_options. HostOptions::default()
is what host uses.
Implementations§
Source§impl HostOptions
impl HostOptions
pub fn new() -> Self
Sourcepub fn max_pipe_instances(self, n: u32) -> Self
pub fn max_pipe_instances(self, n: u32) -> Self
Cap on simultaneous instances of the Windows named pipe: live connections plus the
one instance waiting for the next client. A client that arrives when the cap is
reached gets “pipe busy” and retries, so a flood of connections cannot grow the
host without bound. Default DEFAULT_MAX_PIPE_INSTANCES (16); clamped to
1..=254 (255 is “unlimited” to Win32 and is never used). Ignored on Unix, where
there is no pipe.
Sourcepub fn get_max_pipe_instances(&self) -> u32
pub fn get_max_pipe_instances(&self) -> u32
The effective (clamped) cap.
Sourcepub fn write_timeout(self, bound: Option<Duration>) -> Self
pub fn write_timeout(self, bound: Option<Duration>) -> Self
Longest one frame (hello, event, or response) may take to write and flush to a client.
A client that stops reading fills the transport buffer and would otherwise block the
writing thread, and the connection with it, forever; when the bound passes the host closes
that connection (the client sees connection_closed, never a partial frame it could
mistake for a reply), and the connection’s connection_closed handler hook runs. The
bound is per frame, so a slow but progressing reader of a stream of events is not cut off
unless a single frame stalls. Default DEFAULT_WRITE_TIMEOUT (120 s); None restores
the earlier unbounded write. A zero duration is raised to 1 ms.
Sourcepub fn get_write_timeout(&self) -> Option<Duration>
pub fn get_write_timeout(&self) -> Option<Duration>
The effective write bound (None = unbounded).