Table of Contents

Class RTCTransportStats

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCTransportStats dictionary of the WebRTC API provides information about the transport (RTCDtlsTransport and its underlying RTCIceTransport) used by a particular candidate pair.

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

Remarks

The BUNDLE feature is an SDP extension that allows negotiation to use a single transport for sending and receiving media described by multiple SDP media descriptions.
If the remote endpoint is aware of this feature, all MediaStreamTrack and data channels are bundled onto a single transport at the completion of negotiation.
This is true for current browsers, but if connecting to an older endpoint that is not BUNDLE-aware, then separate transports might be used for different media.
The policy to use in the negotiation is configured in the RTCPeerConnection constructor.

These statistics can be obtained by iterating the RTCStatsReport returned by GetStats(MediaStreamTrack?) until you find a report with the type of transport.

See also on MDN

Constructors

RTCTransportStats()

public RTCTransportStats()

Fields

BytesReceived

The bytesReceived property of the RTCTransportStats dictionary indicates the total number of payload bytes received on this transport.

[Value("bytesReceived")]
public ulong BytesReceived

Field Value

ulong

A positive integer indicating the number of received payload bytes.

Remarks

Only data bytes are counted; overhead such as padding, headers, and so on are not included in this count.

See also on MDN

BytesSent

The bytesSent property of the RTCTransportStats dictionary indicates the total number of payload bytes sent on this transport.

[Value("bytesSent")]
public ulong BytesSent

Field Value

ulong

A positive integer indicating the number of sent payload bytes.

Remarks

Only data bytes are counted; overhead such as padding, headers, and so on are not included in this count.

See also on MDN

DtlsCipher

The dtlsCipher property of the RTCTransportStats dictionary is a string that indicates the descriptive name of the cipher suite used for the DTLS transport.

[Value("dtlsCipher")]
public string DtlsCipher

Field Value

string

A string indicating the name of the DTLS cipher.

Remarks

Allowed names are defined in the "Description" column of the TLS Cipher Suites section in the IANA cipher suite registry.
For example "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256".

See also on MDN

DtlsRole

NOTE
Experimental
The dtlsRole property of the RTCTransportStats dictionary is a string that indicates the role of the associated RTCPeerConnection in the DTLS negotiation.
[Value("dtlsRole")]
public RTCDtlsRole DtlsRole

Field Value

RTCDtlsRole

A string indicating the DTLS role.
This will be one of:

Remarks

Specifically, whether it acted like a server and listened for connections, or like a client and initiated the connection, or that negotiation has not yet started.

See also on MDN

DtlsState

The dtlsState property of the RTCTransportStats dictionary is a string that indicates the current state of the underlying RTCDtlsTransport.

[Value("dtlsState")]
public required RTCDtlsTransportState DtlsState

Field Value

RTCDtlsTransportState

A string that will be one of the following values: new, connecting, connected, closed, failed.

Remarks

This has the same value as the corresponding State property.

See also on MDN

IceLocalUsernameFragment

NOTE
Experimental
The iceLocalUsernameFragment property of the RTCTransportStats dictionary is a string that indicates the local username fragment ("ufrag" or "ice-ufrag") that uniquely identifies the ICE interaction session managed by this transport.
[Value("iceLocalUsernameFragment")]
public string IceLocalUsernameFragment

Field Value

string

A string containing the username fragment that uniquely identifies the ongoing ICE session on the transport.The string may be up to 256 characters long, and has no default value.

Remarks

The same username fragment is used to identify the session for any communication with the STUN server.

This has the same values as the corresponding local UsernameFragment property.
It will change if the connection is renegotiated, for example on ICE restart, or if SetLocalDescription(RTCLocalSessionDescriptionInit) is called.

See also on MDN

IceRole

NOTE
Experimental
The iceRole property of the RTCTransportStats dictionary is a string that indicates the ICE role that the transport is fulfilling: that of the controlling agent, or the agent that is being controlled.
[Value("iceRole")]
public RTCIceRole IceRole

Field Value

RTCIceRole

A string that will be one of the following values: controlled, controlling, or unknown.

Remarks

This has the same value as the Role property of the underlying IceTransport.

See also on MDN

IceState

NOTE
Experimental
The iceState property of the RTCTransportStats dictionary is a string that indicates the current ICE state of the underlying RTCIceTransport.
[Value("iceState")]
public RTCIceTransportState IceState

Field Value

RTCIceTransportState

A string that will be one of the following values: new, checking, connected, completed, disconnected, failed, or closed.

Remarks

This has the same value as the corresponding State property.

See also on MDN

LocalCertificateId

The localCertificateId property of the RTCTransportStats dictionary is a string that indicates the id of the local certificate used by this RTCIceTransport.

[Value("localCertificateId")]
public string LocalCertificateId

Field Value

string

A string that containing the id of the local certificate used by this transport.

Remarks

It is only present for DTLS transports, and after DTLS has been negotiated.

See also on MDN

PacketsReceived

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

Field Value

ulong

A positive integer indicating the number of packets received on the transport.

Remarks

PacketsSent

NOTE
Experimental
The packetsSent property of the RTCTransportStats dictionary indicates the total number of packets sent over this transport.
[Value("packetsSent")]
public ulong PacketsSent

Field Value

ulong

A positive integer indicating the number of packets sent on the transport.

Remarks

RemoteCertificateId

The remoteCertificateId property of the RTCTransportStats dictionary is a string that indicates the id of the remote certificate used by this RTCIceTransport.

[Value("remoteCertificateId")]
public string RemoteCertificateId

Field Value

string

A string that containing the id of the remote certificate used by this transport.

Remarks

It is only present for DTLS transports, and after DTLS has been negotiated.

See also on MDN

SelectedCandidatePairChanges

The selectedCandidatePairChanges property of the RTCTransportStats dictionary indicates the total number of times that the selected candidate pair of this transport has changed.

[Value("selectedCandidatePairChanges")]
public ulong SelectedCandidatePairChanges

Field Value

ulong

A positive integer that is initially zero and increases whenever a candidate pair is selected or lost.

Remarks

SelectedCandidatePairId

The selectedCandidatePairId property of the RTCTransportStats dictionary represents the unique identifier for the candidate pair stats associated with this transport.

[Value("selectedCandidatePairId")]
public string SelectedCandidatePairId

Field Value

string

A string that contains the unique identifier for the object that was inspected to produce the RTCIceCandidatePairStats associated with this transport.

Remarks

SrtpCipher

The srtpCipher property of the RTCTransportStats dictionary indicates the descriptive name of the protection profile used for the Secure Real-time Transport Protocol (SRTP) transport.

[Value("srtpCipher")]
public string SrtpCipher

Field Value

string

A string that indicates the descriptive name of the SRTP protection profile.Values are defined in the "Profile" column of the IANA DTLS-SRTP protection profile registry and {{rfc("5764","", "4.1.2")}}.

Remarks

TlsVersion

The tlsVersion property of the RTCTransportStats dictionary indicates the negotiated TLS version of an underlying DTLS transport.

[Value("tlsVersion")]
public string TlsVersion

Field Value

string

A string that indicates the negotiated DTS transport.

Remarks

It is only present for DTLS transports, and only exists after DTLS has been negotiated.

The value comes from the DTLS handshake ServerHello.version, and is represented as four upper case hexadecimal digits, where the digits represent the two bytes of the version.
Note however that the bytes might not map directly to version numbers.
For example, DTLS represents version 1.2 as 'FEFD' which numerically is {254, 253}.

See also on MDN