pub struct EngineIoConfig {
pub req_path: Cow<'static, str>,
pub ping_interval: Duration,
pub ping_timeout: Duration,
pub max_buffer_size: usize,
pub max_payload: u64,
pub ws_read_buffer_size: usize,
pub transports: u8,
}Expand description
Configuration for the engine.io engine & transports
Fields§
§req_path: Cow<'static, str>The path to listen for engine.io requests on. Defaults to “/engine.io”.
ping_interval: DurationThe interval at which the server will send a ping packet to the client. Defaults to 25 seconds.
ping_timeout: DurationThe amount of time the server will wait for a ping response from the client before closing the connection. Defaults to 20 seconds.
max_buffer_size: usizeThe maximum number of packets that can be buffered per connection before being emitted to the client.
If the buffer if full the emit() method will return an error
Defaults to 128 packets
max_payload: u64The maximum number of bytes that can be received per http request. Defaults to 100KB.
ws_read_buffer_size: usizeThe size of the read buffer for the websocket transport. You can tweak this value depending on your use case. By default it is set to 4KiB.
Setting it to a higher value will improve performance on heavy read scenarios but will consume more memory.
transports: u8Allowed transports on this server It is represented as a bitfield to allow to combine any number of transports easily
Implementations§
Source§impl EngineIoConfig
impl EngineIoConfig
Sourcepub fn builder() -> EngineIoConfigBuilder
pub fn builder() -> EngineIoConfigBuilder
Create a new builder with a default config
Sourcepub fn allowed_transport(&self, transport: TransportType) -> bool
pub fn allowed_transport(&self, transport: TransportType) -> bool
Check if a TransportType is enabled in the EngineIoConfig
Trait Implementations§
Source§impl Clone for EngineIoConfig
impl Clone for EngineIoConfig
Source§fn clone(&self) -> EngineIoConfig
fn clone(&self) -> EngineIoConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more