Table of Contents

Class RTCDataChannelStats

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCDataChannelStats dictionary of the WebRTC API provides statistics related to one RTCDataChannel object on the connection.

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

Remarks

The report can be obtained by iterating the RTCStatsReport returned by GetStats(MediaStreamTrack?) until you find an entry with the type of data-channel.

The data channels statistics may be correlated to a particular channel by comparing the dataChannelIdentifier property to a matching Id.

See also on MDN

Constructors

RTCDataChannelStats()

public RTCDataChannelStats()

Fields

BytesReceived

The bytesReceived property of the RTCDataChannelStats dictionary returns the total number of payload bytes received on the associated RTCDataChannel.

[Value("bytesReceived")]
public ulong BytesReceived

Field Value

ulong

A positive integer value indicating the total number of payload bytes received on the associated data channel.

Remarks

Note that non-payload bytes, such as those for framing and in headers, are not included.

-RTCDataChannel

See also on MDN

BytesSent

The bytesSent property of the RTCDataChannelStats dictionary returns the total number of payload bytes sent on the associated RTCDataChannel.

[Value("bytesSent")]
public ulong BytesSent

Field Value

ulong

A positive integer value indicating the total number of payload bytes sent on the associated data channel.

Remarks

Note that non-payload bytes, such as those for framing and in headers, are not included.

-RTCDataChannel

See also on MDN

DataChannelIdentifier

The dataChannelIdentifier property of the RTCDataChannelStats dictionary containing the Id of the associated RTCDataChannel providing these statistics.

[Value("dataChannelIdentifier")]
public ushort DataChannelIdentifier

Field Value

ushort

A string containing the same value as the Id property of the associated data channel.

Remarks

Using the dataChannelIdentifier, you can correlate this statistics object to a particular RTCDataChannel.

See also on MDN

Label

The label property of the RTCDataChannelStats dictionary returns the Label of the associated data channel.

[Value("label")]
public string Label

Field Value

string

A string containing the same value as the Label property of the associated data channel.

Remarks

The value of the label need not be unique, and its meaning is defined by the website or app when it creates the data channel.

-Label

See also on MDN

MessagesReceived

The messagesReceived property of the RTCDataChannelStats dictionary returns the total number of message events fired for received messages on the associated RTCDataChannel.

[Value("messagesReceived")]
public ulong MessagesReceived

Field Value

ulong

A positive integer value indicating the total number of message events for inbound data on the associated data channel.

Remarks

MessagesSent

The messagesSent property of the RTCDataChannelStats dictionary returns the total number of message events fired for sent messages on the associated RTCDataChannel.

[Value("messagesSent")]
public ulong MessagesSent

Field Value

ulong

A positive integer value indicating the total number of message events for outbound data on the associated data channel.

Remarks

Protocol

The protocol property of the RTCDataChannelStats dictionary returns a string containing the Protocol of the associated data channel.

[Value("protocol")]
public string Protocol

Field Value

string

A string containing the same value as the Protocol property of the associated data channel.If no protocol was defined, this will be the empty string ("").

Remarks

The value is defined by the website or app when it creates the data channel.

-Protocol

See also on MDN

State

The state property of the RTCDataChannelStats dictionary returns a string that indicates the ReadyState of the data channel's underlying data connection: connecting, open, closing or closed.

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

Field Value

RTCDataChannelState

A string containing the same value as the ReadyState property of the associated data channel.

Remarks

Note that this property is required.

-ReadyState

See also on MDN