Struct cobalt::BinaryRateLimiter
[−]
[src]
pub struct BinaryRateLimiter { /* fields omitted */ }
Implementation of a binary state rate limiter for congestion avoidance.
It is based on the example design from the following article: http://gafferongames.com/networking-for-game-programmers/reliability-and-flow-control/
Trait Implementations
impl Debug for BinaryRateLimiter
[src]
impl RateLimiter for BinaryRateLimiter
[src]
fn new(config: Config) -> BinaryRateLimiter
Method that constructs a new rate limiter using the provided configuration.
fn update(&mut self, rtt: u32, _: f32)
Method implementing a congestion avoidance algorithm based on round trip time and packet loss. Read more
fn congested(&self) -> bool
Method that should return true
in case the connection is currently considered congested and should reduce the number of packets it sends per second. Read more
fn should_send(&self) -> bool
Method that returns whether a connection should be currently sending packets or not. Read more
fn reset(&mut self)
Method that resets any internal state of the rate limiter.