pub struct Receiver {
    pub latency: Duration,
    pub reorder_tolerance_max: PacketCount,
    pub buffer_size: ByteCount,
    pub nak_report: bool,
    pub too_late_packet_drop: bool,
    pub drift_tracer: bool,
}

Fields§

§latency: Duration

SRTO_RCVLATENCY

The latency value in the receiving direction of the socket. This value is only significant when SRTO_TSBPDMODE is enabled.

Default value: 120 ms in Live mode, 0 in File mode (see SRTO_TRANSTYPE).

The latency value defines the minimum receiver buffering delay before delivering an SRT data packet from a receiving SRT socket to a receiving application. The provided value is used in the connection establishment (handshake exchange) stage to fix the end-to-end latency of the transmission. The effective end-to-end latency L will be fixed as the network transmission time of the final handshake packet (~1/2 RTT) plus the negotiated latency value Ln. Data packets will stay in the receiver buffer for at least L microseconds since the timestamp of the packet, independent of the actual network transmission times (RTT variations) of these packets.

The actual value of the receiver buffering delay Ln (the negotiated latency) used on a connection is determined by the negotiation in the connection establishment (handshake exchange) phase as the maximum of the SRTO_RCVLATENCY value and the value of SRTO_PEERLATENCY set by the peer.

Reading the SRTO_RCVLATENCY value on a socket after the connection is established provides the actual (negotiated) latency value Ln.

The receiver’s buffer must be large enough to store the L segment of the stream, i.e. L × Bitrate bytes. Refer to SRTO_RCVBUF.

The sender’s buffer must be large enough to store a packet up until it is either delivered (and acknowledged) or dropped by the sender due to it becoming too late to be delivered. In other words, D × Bitrate bytes, where D is the sender’s drop delay value configured with SRTO_SNDDROPDELAY.

Buffering of data packets on the receiving side makes it possible to recover from packet losses using the ARQ (Automatic Repeat Request) technique, and to deal with varying RTT times (network jitter) in the network, providing a (close to) constant end-to-end latency of the transmission.

§reorder_tolerance_max: PacketCount

SRTO_LOSSMAXTTL The value up to which the Reorder Tolerance may grow. The Reorder Tolerance is the number of packets that must follow the experienced “gap” in sequence numbers of incoming packets so that the loss report is sent (in the hope that the gap is due to packet reordering rather than because of loss). The value of Reorder Tolerance starts from 0 and is set to a greater value when packet reordering is detected This happens when a “belated” packet, with sequence number older than the latest received, has been received, but without retransmission flag. When this is detected the Reorder Tolerance is set to the value of the interval between latest sequence and this packet’s sequence, but not more than the value set by SRTO_LOSSMAXTTL. By default this value is set to 0, which means that this mechanism is off.

§buffer_size: ByteCount

SRTO_RCVBUF

Receive Buffer Size, in bytes. Note, however, that the internal setting of this value is in the number of buffers, each one of size equal to SRT payload size, which is the value of SRTO_MSS decreased by UDP and SRT header sizes (28 and 16). The value set here will be effectively aligned to the multiple of payload size.

Minimum value: 32 buffers (46592 with default value of SRTO_MSS).

Maximum value: SRTO_FC number of buffers (receiver buffer must not be greater than the Flight Flag size).

§nak_report: bool

SRTO_NAKREPORT When set to true, every report for a detected loss will be repeated when the timeout for the expected retransmission of this loss has expired and the missing packet still wasn’t recovered, or wasn’t conditionally dropped (see SRTO_TLPKTDROP).

The default is true for Live mode

§too_late_packet_drop: bool

SRTO_TLPKTDROP Too-late Packet Drop. When enabled on receiver, it skips missing packets that have not been delivered in time and delivers the subsequent packets to the application when their time-to-play has come. It also sends a fake ACK to the sender. When enabled on sender and enabled on the receiving peer, sender drops the older packets that have no chance to be delivered in time. It is automatically enabled in sender if receiver supports it.

§drift_tracer: bool

SRTO_DRIFTTRACER - Enable/disable drift tracer - unit: bool, default: true, range: t|f Enables or disables time drift tracer (receiver).

Trait Implementations§

source§

impl Clone for Receiver

source§

fn clone(&self) -> Receiver

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 Receiver

source§

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

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

impl Default for Receiver

source§

fn default() -> Self

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

impl OptionsOf<Receiver> for CallerOptions

source§

fn set_options(&mut self, value: Receiver)

source§

impl OptionsOf<Receiver> for ListenerOptions

source§

fn set_options(&mut self, value: Receiver)

source§

impl OptionsOf<Receiver> for RendezvousOptions

source§

fn set_options(&mut self, value: Receiver)

source§

impl OptionsOf<Receiver> for SocketOptions

source§

fn set_options(&mut self, value: Receiver)

source§

impl PartialEq<Receiver> for Receiver

source§

fn eq(&self, other: &Receiver) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Validation for Receiver

§

type Error = OptionsError

source§

fn is_valid(&self) -> Result<(), Self::Error>

source§

fn try_validate(self) -> Result<Valid<Self>, Self::Error>

source§

impl Eq for Receiver

source§

impl StructuralEq for Receiver

source§

impl StructuralPartialEq for Receiver

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V