Struct laminar::Config[][src]

pub struct Config {
Show fields pub blocking_mode: bool, pub idle_connection_timeout: Duration, pub heartbeat_interval: Option<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>, pub max_packets_in_flight: u16, pub max_unestablished_connections: u16,
}

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

Fields

blocking_mode: bool

Make the underlying UDP socket block when true, otherwise non-blocking.

idle_connection_timeout: Duration

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

heartbeat_interval: Option<Duration>

Value which specifies at which interval (if at all) a heartbeat should be sent, if no other packet was sent in the meantime. If None, no heartbeats will be sent (the default).

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.

max_packets_in_flight: u16

The maximum amount of reliable packets in flight on this connection before we drop the connection.

When we send a reliable packet, it is stored locally until an acknowledgement comes back to us, if that store grows to a size.

max_unestablished_connections: u16

The maximum number of unestablished connections that laminar will track internally. This is used to prevent malicious packet flooding from consuming an unbounded amount of memory.

Trait Implementations

impl Clone for Config[src]

fn clone(&self) -> Config[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for Config[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Config[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V