Struct srt_protocol::options::Receiver
source · 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 OptionsOf<Receiver> for CallerOptions
impl OptionsOf<Receiver> for CallerOptions
fn set_options(&mut self, value: Receiver)
source§impl OptionsOf<Receiver> for ListenerOptions
impl OptionsOf<Receiver> for ListenerOptions
fn set_options(&mut self, value: Receiver)
source§impl OptionsOf<Receiver> for RendezvousOptions
impl OptionsOf<Receiver> for RendezvousOptions
fn set_options(&mut self, value: Receiver)
source§impl OptionsOf<Receiver> for SocketOptions
impl OptionsOf<Receiver> for SocketOptions
fn set_options(&mut self, value: Receiver)
source§impl PartialEq<Receiver> for Receiver
impl PartialEq<Receiver> for Receiver
source§impl Validation for Receiver
impl Validation for Receiver
impl Eq for Receiver
impl StructuralEq for Receiver
impl StructuralPartialEq for Receiver
Auto Trait Implementations§
impl RefUnwindSafe for Receiver
impl Send for Receiver
impl Sync for Receiver
impl Unpin for Receiver
impl UnwindSafe for Receiver
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.