pub struct StunUdpTransporterBuilder { /* private fields */ }
Expand description

Implementations§

source§

impl StunUdpTransporterBuilder

source

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.

RFC 5389 – 7.2.1. Sending over UDP

source

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.

RFC 5389 – 7.2.1. Sending over UDP

source

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.

RFC 5389 – 7.2. Sending the Request or Indication

source

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.

RFC 5389 – 7.2. Sending the Request or Indication

source

pub fn new() -> Self

Makes a new StunUdpTransporterBuilder instance with the default settings.

source

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).

source

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).

source

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).

source

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.

source

pub fn finish<A, T>(&self, inner: T) -> StunUdpTransporter<A, T>
where A: Attribute, T: UdpTransport<SendItem = Message<A>, RecvItem = DecodedMessage<A>>,

Makes a new StunUdpTransporter instance with the given settings.

Trait Implementations§

source§

impl Clone for StunUdpTransporterBuilder

source§

fn clone(&self) -> StunUdpTransporterBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StunUdpTransporterBuilder

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for StunUdpTransporterBuilder

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V