[][src]Struct laminar::Config

pub struct Config {
    pub idle_connection_timeout: Duration,
    pub max_packet_size: usize,
    pub max_fragments: u8,
    pub fragment_size: u16,
    pub fragment_reassembly_buffer_size: u16,
    pub receive_buffer_max_size: usize,
    pub rtt_smoothing_factor: f32,
    pub rtt_max_value: u16,
    pub socket_event_buffer_size: usize,
    pub socket_polling_timeout: Option<Duration>,
}

Contains the configuration options to configure laminar for special use-cases.

Fields

idle_connection_timeout: Duration

Value which can specify the amount of time that can pass without hearing from a client before considering them disconnected

max_packet_size: usize

Value which can specify the maximum size a packet can be in bytes. This value is inclusive of fragmenting; if a packet is fragmented, the total size of the fragments cannot exceed this value.

Recommended value: 16384

max_fragments: u8

Value which can specify the maximal allowed fragments.

Why can't I have more than 255 (u8)? This is because you don't want to send more then 256 fragments over UDP, with high amounts of fragments the chance for an invalid packet is very high. Use TCP instead (later we will probably support larger ranges but every fragment packet then needs to be resent if it doesn't get an acknowledgment).

default: 16 but keep in mind that lower is better.

fragment_size: u16

Value which can specify the size of a fragment.

This is the maximum size of each fragment. It defaults to 1450 bytes, due to the default MTU on most network devices being 1500.

fragment_reassembly_buffer_size: u16

Value which can specify the size of the buffer that queues up fragments ready to be reassembled once all fragments have arrived.```

receive_buffer_max_size: usize

Value that specifies the size of the buffer the UDP data will be read into. Defaults to 1450 bytes.

rtt_smoothing_factor: f32

Value which can specify the factor which will smooth out network jitter.

use-case: If one packet hast not arrived we don't directly want to transform to a bad network state. Value that specifies the factor used to smooth out network jitter. It defaults to 10% of the round-trip time. It is expressed as a ratio, with 0 equal to 0% and 1 equal to 100%. This helps prevent flapping of VirtualConnections

rtt_max_value: u16

Value which can specify the maximal round trip time (rtt) for packet.

Value which specifies the maximum round trip time before we consider it a problem. This is expressed in milliseconds.

socket_event_buffer_size: usize

Value which can specify the event buffer we read socket events into.

Value that specifies the size of the event buffer into which we receive socket events, in bytes. Defaults to 1024.

socket_polling_timeout: Option<Duration>

Value which can specify how long we should block polling for socket events.

Value that specifies how long we should block polling for socket events, in milliseconds. Defaults to 1ms.

Trait Implementations

impl Default for Config[src]

impl Clone for Config[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]