[][src]Struct zelda::Config

pub struct Config {
    pub timeout: Duration,
    pub timeout_check_interval: Duration,
    pub event_capacity: usize,
    pub rtt_alpha: f32,
    pub rtt_queue_capacity: usize,
}

Fields

timeout: Duration

The amount of time without communication that can be passed before a client is considered disconnected.

timeout_check_interval: Duration

How often to check for timeouts of connections. Under the hood, this is done in a separate thread and will lock individual connections while checking.

event_capacity: usize

Number of incoming events the socket can hold before it blocks reading from the UDP-socket. If the capacity is reached the underlying receive buffer may also reach its capacity resulting in packets being dropped.

rtt_alpha: f32

Factor used for smoothing RTT, formula: ((1.0 - rtt_alpha) * previous_estimate) + (rtt_alpha * sample_rtt)

rtt_queue_capacity: usize

Capacity of the queue that records RTT, lower capacity can mean less measurements. Set this based on the send-rate of the client and server, and the expected maximum RTT.

Example: Given a symmetric send-rate of 60Hz and an expected maximum RTT of 1 second, we can expect there to be a maximum of 60 outstanding acknowledgements at any given time. Therefore we need the capacity to hold at least 60 acks in order to get accurate readings.

Methods

impl Config[src]

pub fn default() -> Self[src]

pub fn new(
    timeout: Duration,
    timeout_check_interval: Duration,
    event_capacity: usize,
    rtt_alpha: f32,
    rtt_queue_capacity: usize
) -> Self
[src]

Trait Implementations

impl Clone for Config[src]

impl Copy for Config[src]

impl Debug for Config[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

impl RefUnwindSafe for Config

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.

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

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

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

impl<T> Erased for T