Table of Contents

Class RTCIceCandidatePairStats

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCIceCandidatePairStats dictionary of the WebRTC API is used to report statistics that provide insight into the quality and performance of an RTCPeerConnection while connected and configured as described by the specified pair of {{Glossary("ICE")}} candidates.

[ToObject]
public class RTCIceCandidatePairStats : RTCStats
Inheritance
RTCIceCandidatePairStats
Inherited Members

Remarks

The statistics can be obtained by iterating the RTCStatsReport returned by GetStats(MediaStreamTrack?) until you find an entry with the type of "candidate-pair".

See also on MDN

Constructors

RTCIceCandidatePairStats()

public RTCIceCandidatePairStats()

Fields

AvailableIncomingBitrate

The availableIncomingBitrate property of the RTCIceCandidatePairStats dictionary indicates the available inbound capacity of the network connection represented by the candidate pair.
The higher the value, the more bandwidth you can assume is available for incoming data.

[Value("availableIncomingBitrate")]
public Number AvailableIncomingBitrate

Field Value

Number

A number which approximates the amount of available bandwidth for incoming data on the network connection described by the RTCIceCandidatePair.
The value is reported in bits per second and is computed over a 1-second interval.The value returned is calculated by adding up the available bit rate for every RTP stream using the connection described by this candidate pair.
The returned value doesn't take into account overhead introduced by underlying protocols, including IP, UDP, or TCP.

NOTE
The returned value is computed using a method similar—but not identical—to the Transport Independent Application Specific Maximum (TIAS) described in {{RFC(3890, "", "6.2")}}.

Remarks

You can get the outgoing available bitrate from AvailableOutgoingBitrate.

See also on MDN

AvailableOutgoingBitrate

The availableOutgoingBitrate property of the RTCIceCandidatePairStats dictionary indicates the available outbound capacity of the network connection represented by the candidate pair.
The higher the value, the more bandwidth you can assume is available for outgoing data.

[Value("availableOutgoingBitrate")]
public Number AvailableOutgoingBitrate

Field Value

Number

A number which approximates the amount of available bandwidth for outgoing data on the network connection described by the
RTCIceCandidatePair.
The value is reported in bits per second and is computed over a 1-second interval.The returned value is undefined in each of the following situations:The value returned is calculated by adding up the available bit rate for every RTP stream using the connection described by this candidate pair.
The returned value doesn't take into account overhead introduced by underlying protocols, including IP, UDP, or TCP.

NOTE
The returned value is computed using a method similar—but not identical—to the Transport Independent Application Specific Maximum (TIAS) described in {{RFC(3890, "", "6.2")}}.

Remarks

You can get the incoming available bitrate from AvailableIncomingBitrate.

See also on MDN

BytesDiscardedOnSend

NOTE
Experimental
The bytesDiscardedOnSend property of the RTCIceCandidatePairStats dictionary indicates the total number of bytes discarded due to socket errors.
[Value("bytesDiscardedOnSend")]
public ulong BytesDiscardedOnSend

Field Value

ulong

An integer value indicating the total number of bytes discarded due to socket errors.
This is calculated as defined in {{rfc("3550","", "6.4.1")}}.

Remarks

The errors might be caused, for example, by attempting to pass packets to the socket when it is full.

See also on MDN

BytesReceived

The bytesReceived property of the RTCIceCandidatePairStats dictionary indicates the total number of received payload bytes that have been received so far on the connection described by the candidate pair.

[Value("bytesReceived")]
public ulong BytesReceived

Field Value

ulong

An integer indicating the total number of bytes received so far on the connection described by this candidate pair.Only data bytes are counted; overhead such as padding, headers, and the like are not included in this count.

Remarks

BytesSent

The bytesSent property of the RTCIceCandidatePairStats dictionary indicates the total number of payload bytes that have been sent so far on the connection described by the candidate pair.

[Value("bytesSent")]
public ulong BytesSent

Field Value

ulong

An integer value indicating the total number of bytes sent so far on the connection described by this candidate pair.Only data bytes are counted; overhead such as padding, headers, and the like are not included in this count.

Remarks

ConsentRequestsSent

NOTE
Experimental
The consentRequestsSent property of the RTCIceCandidatePairStats dictionary indicates the total number of consent requests sent on this candidate pair.
[Value("consentRequestsSent")]
public ulong ConsentRequestsSent

Field Value

ulong

An integer value indicating the total number consent requests sent to the peers in the candidate pair.

Remarks

If either or both of the peers in the pair access the internet via Network Address Translation (NAT), the other peer will need to regularly send a Session Traversal Utilities for NAT (STUN) request to the NAT firewall to ask for consent to allow traffic to flow.
This property counts the number of requests.
{{rfc("7675")}} has more information about NAT and consent.

See also on MDN

CurrentRoundTripTime

The currentRoundTripTime property of the RTCIceCandidatePairStats dictionary indicates the number of seconds it takes for data to be sent by this peer to the remote peer and back over the connection described by this pair of {{Glossary("ICE")}} candidates.

[Value("currentRoundTripTime")]
public Number CurrentRoundTripTime

Field Value

Number

A number indicating the round-trip time, in seconds, for the connection described by the pair of candidates for which this RTCIceCandidatePairStats object offers statistics.This value is computed by observing the time that elapsed between the most recent STUN request being sent to the remote peer and the response to that request arriving.
This information may come from ongoing STUN connectivity checks as well as from consent requests made when the connection was initially being opened.

Remarks

LastPacketReceivedTimestamp

The lastPacketReceivedTimestamp property of the RTCIceCandidatePairStats dictionary indicates the time at which the connection described by the candidate pair last received a packet.

[Value("lastPacketReceivedTimestamp")]
public Number LastPacketReceivedTimestamp

Field Value

Number

A Number object indicating the timestamp at which the connection described by pair of candidates last received a packet, STUN packets excluded.

Remarks

STUN packets are not included.

See also on MDN

LastPacketSentTimestamp

The lastPacketSentTimestamp property of the RTCIceCandidatePairStats dictionary indicates the time at which the connection described by the candidate pair last sent a packet, not including {{Glossary("STUN")}} packets.

[Value("lastPacketSentTimestamp")]
public Number LastPacketSentTimestamp

Field Value

Number

A Number object indicating the timestamp at which the connection described by pair of candidates last sent a packet, STUN packets excluded.

Remarks

LocalCandidateId

The localCandidateId property of the RTCIceCandidatePairStats dictionary is a string that uniquely identifies the local {{Glossary("ICE")}} candidate which was analyzed to generate the RTCIceCandidateStats used to compute the statistics for this pair of candidates.

[Value("localCandidateId")]
public required string LocalCandidateId

Field Value

string

A string giving a unique identifier for the local RTCIceCandidate for the connection described by this RTCIceCandidatePairStats object.This candidate is the source of one of the two RTCIceCandidateStats objects that were used to compute the contents of this RTCIceCandidatePairStats object.

Remarks

Nominated

The nominated property of the RTCIceCandidatePairStats dictionary specifies whether or not the candidate pair described by the underlying RTCIceCandidatePair has been nominated to be used as the configuration for the WebRTC connection.

[Value("nominated")]
public bool Nominated

Field Value

bool

A Boolean value which is set to true by the ICE layer if the controlling user agent has indicated that the candidate pair should be used to configure the WebRTC connection between the two peers.

NOTE
If more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use.
Once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the specified configuration, the ICE negotiation process can potentially end (or it can continue, to allow the connection to adapt to changing conditions).

Remarks

PacketsDiscardedOnSend

NOTE
Experimental
The packetsDiscardedOnSend property of the RTCIceCandidatePairStats dictionary indicates the total number of packets discarded due to socket errors
[Value("packetsDiscardedOnSend")]
public ulong PacketsDiscardedOnSend

Field Value

ulong

An integer value indicating the total number of packets discarded due to socket errors.

Remarks

The errors might be caused, for example, by attempting to pass packets to the socket when it is full.

-BytesDiscardedOnSend

See also on MDN

PacketsReceived

NOTE
Experimental
The packetsReceived property of the RTCIceCandidatePairStats dictionary indicates the total number of packets received on the candidate pair.
[Value("packetsReceived")]
public ulong PacketsReceived

Field Value

ulong

An integer value indicating the total number of packets received on the pair.

Remarks

PacketsSent

NOTE
Experimental
The packetsSent property of the RTCIceCandidatePairStats dictionary indicates the total number of packets sent on the candidate pair.
[Value("packetsSent")]
public ulong PacketsSent

Field Value

ulong

An integer value indicating the total number of packets sent on the pair.

Remarks

RemoteCandidateId

The remoteCandidateId property of the RTCIceCandidatePairStats dictionary uniquely identifies the remote {{Glossary("ICE")}} candidate which was analyzed to generate the RTCIceCandidateStats used to compute the statistics for this pair of candidates.

[Value("remoteCandidateId")]
public required string RemoteCandidateId

Field Value

string

A string uniquely identifying the remote ICE candidate—that is, the candidate describing a configuration for the remote peer—which is represented by the remote end of these statistics.

Remarks

RequestsReceived

The requestsReceived property of the RTCIceCandidatePairStats dictionary indicates the total number of {{Glossary("STUN")}} connectivity check requests that have been received so far on the connection described by this pairing of candidates.

[Value("requestsReceived")]
public ulong RequestsReceived

Field Value

ulong

An integer value which specifies the number of STUN connectivity and/or consent requests that have been received to date on the connection described by this pair of ICE candidates.Because there's no way to tell the difference between requests made to check connectivity and requests made to check consent, the returned figure includes both.

NOTE
The reported number of requests includes retransmissions.
If a request had to be repeated due to network issues, it will be counted multiple times here.
This differs from RequestsSent, which does not include retransmissions.

Remarks

RequestsSent

The requestsSent property of the RTCIceCandidatePairStats dictionary indicates the total number of {{Glossary("STUN")}} connectivity check requests that have been sent so far on the connection described by this pair of candidates.

[Value("requestsSent")]
public ulong RequestsSent

Field Value

ulong

An integer value which specifies the number of STUN connectivity requests that have been sent to date on the connection described by this pair of ICE candidates.

NOTE
The reported number of requests does not include retransmissions.
If a request had to be repeated due to network issues, it will be counted multiple times here.
This differs from RequestsReceived, which does include retransmissions.

Remarks

ResponsesReceived

The responsesReceived property of the RTCIceCandidatePairStats dictionary indicates the total number of {{Glossary("STUN")}} connectivity check responses that have been received on the connection described by this pair of candidates.

[Value("responsesReceived")]
public ulong ResponsesReceived

Field Value

ulong

An integer value which specifies the number of STUN connectivity request responses that have been received on the connection described by this pair of candidates so far.

Remarks

ResponsesSent

The responsesSent property of the RTCIceCandidatePairStats dictionary indicates the total number of {{Glossary("STUN")}} connectivity check responses that have been sent so far on the connection described by this pair of candidates.

[Value("responsesSent")]
public ulong ResponsesSent

Field Value

ulong

An integer value indicating the number of times a response has been sent to a STUN connectivity check request.

NOTE
Since it isn't possible to tell the difference between connectivity check requests and consent requests, this value includes both.

Remarks

State

The state property of the RTCIceCandidatePairStats dictionary indicates the state of the checklist of which the candidate pair is a member.

[Value("state")]
public required RTCStatsIceCandidatePairState State

Field Value

RTCStatsIceCandidatePairState

A string whose value is one of the following:

Remarks

TotalRoundTripTime

The totalRoundTripTime property of the RTCIceCandidatePairStats dictionary indicates the total time that has elapsed between sending {{Glossary("STUN")}} requests and receiving the responses, for all such requests that have been made so far on the pair of candidates described by this RTCIceCandidatePairStats object.

[Value("totalRoundTripTime")]
public Number TotalRoundTripTime

Field Value

Number

This real number indicates the total number of seconds which have elapsed between sending out STUN connectivity and consent check requests and receiving their responses, for all such requests made so far on the connection described by this candidate pair.You can calculate the average round-trip time (RTT) by dividing this value by the value of the ResponsesReceived property:

Remarks

This value includes both connectivity check and consent check requests.

See also on MDN

TransportId

The transportId property of the RTCIceCandidatePairStats dictionary uniquely identifies the RTCIceTransport object that was inspected to obtain the transport-related statistics contained in the stats object.

[Value("transportId")]
public required string TransportId

Field Value

string

A string which uniquely identifies the RTCIceTransport object from which the transport-related data was obtained for the statistics contained in this RTCIceCandidatePairStats object.The transport-related statistics come from the RTCTransportStats dictionary.

Remarks