[−][src]Struct zelda::Config
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]
timeout: Duration,
timeout_check_interval: Duration,
event_capacity: usize,
rtt_alpha: f32,
rtt_queue_capacity: usize
) -> Self
Trait Implementations
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,