Struct rustun::transport::StunUdpTransporterBuilder
source · pub struct StunUdpTransporterBuilder { /* private fields */ }
Expand description
StunUdpTransporter
builder.
Implementations§
source§impl StunUdpTransporterBuilder
impl StunUdpTransporterBuilder
sourcepub const DEFAULT_RTO_MS: u64 = 500u64
pub const DEFAULT_RTO_MS: u64 = 500u64
The default value of RTO (Retransmission TimeOut).
A client SHOULD retransmit a STUN request message starting with an interval of RTO (“Retransmission TimeOut”), doubling after each retransmission. The RTO is an estimate of the round-trip time (RTT), and is computed as described in RFC 2988 [RFC2988], with two exceptions. First, the initial value for RTO SHOULD be configurable (rather than the 3 s recommended in RFC 2988) and SHOULD be greater than 500 ms.
sourcepub const DEFAULT_RTO_CACHE_DURATION_MS: u64 = 600_000u64
pub const DEFAULT_RTO_CACHE_DURATION_MS: u64 = 600_000u64
The default duration preserving a cached RTO (Retransmission TimeOut).
The value for RTO SHOULD be cached by a client after the completion of the transaction, and used as the starting value for RTO for the next transaction to the same server (based on equality of IP address). The value SHOULD be considered stale and discarded after 10 minutes.
sourcepub const DEFAULT_MAX_OUTSTANDING_TRANSACTIONS: usize = 10usize
pub const DEFAULT_MAX_OUTSTANDING_TRANSACTIONS: usize = 10usize
The default max concurrent transactions by a client to a server.
At any time, a client MAY have multiple outstanding STUN requests with the same STUN server (that is, multiple transactions in progress, with different transaction IDs). Absent other limits to the rate of new transactions (such as those specified by ICE for connectivity checks or when STUN is run over TCP), a client SHOULD space new transactions to a server by RTO and SHOULD limit itself to ten outstanding transactions to the same server.
sourcepub const DEFAULT_MIN_TRANSACTION_INTERVAL_MS: u64 = 500u64
pub const DEFAULT_MIN_TRANSACTION_INTERVAL_MS: u64 = 500u64
The default interval between transactions issued by a client to a serve.
At any time, a client MAY have multiple outstanding STUN requests with the same STUN server (that is, multiple transactions in progress, with different transaction IDs). Absent other limits to the rate of new transactions (such as those specified by ICE for connectivity checks or when STUN is run over TCP), a client SHOULD space new transactions to a server by RTO and SHOULD limit itself to ten outstanding transactions to the same server.
sourcepub fn rto(&mut self, rto: Duration) -> &mut Self
pub fn rto(&mut self, rto: Duration) -> &mut Self
Sets the RTO of the resulting instance.
The default value is Duration::from_millis(DEFAULT_RTO_MS)
.
sourcepub fn rto_cache_duration(&mut self, duration: Duration) -> &mut Self
pub fn rto_cache_duration(&mut self, duration: Duration) -> &mut Self
Sets the RTO cache duration of the resulting instance.
The default value is Duration::from_millis(DEFAULT_RTO_CACHE_DURATION_MS)
.
sourcepub fn min_transaction_interval(&mut self, interval: Duration) -> &mut Self
pub fn min_transaction_interval(&mut self, interval: Duration) -> &mut Self
Sets the minimum interval of the consecutive request/response transactions of the resulting instance.
The default value is Duration::from_millis(DEFAULT_MIN_TRANSACTION_INTERVAL_MS)
.
sourcepub fn max_outstanding_transactions(&mut self, max: usize) -> &mut Self
pub fn max_outstanding_transactions(&mut self, max: usize) -> &mut Self
Sets the number of the maximum outstanding transactions of the resulting instance.
The default value is DEFAULT_MAX_OUTSTANDING_TRANSACTIONS
.
sourcepub fn finish<A, T>(&self, inner: T) -> StunUdpTransporter<A, T>
pub fn finish<A, T>(&self, inner: T) -> StunUdpTransporter<A, T>
Makes a new StunUdpTransporter
instance with the given settings.
Trait Implementations§
source§impl Clone for StunUdpTransporterBuilder
impl Clone for StunUdpTransporterBuilder
source§fn clone(&self) -> StunUdpTransporterBuilder
fn clone(&self) -> StunUdpTransporterBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more