RTCDataChannel

The RTCDataChannel interface represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data.

MDN Reference

Properties

Link copied to clipboard

The property binaryType on the the type of object which should be used to represent binary data received on the RTCDataChannel.

Link copied to clipboard

The read-only RTCDataChannel property bufferedAmount returns the number of bytes of data currently queued to be sent over the data channel.

Link copied to clipboard

The RTCDataChannel property bufferedAmountLowThreshold is used to specify the number of bytes of buffered outgoing data that is considered 'low.' The default value is 0\.

Link copied to clipboard
val id: Short?

The read-only RTCDataChannel property id returns an ID number (between 0 and 65,534) which uniquely identifies the RTCDataChannel.

Link copied to clipboard

The read-only RTCDataChannel property label returns a string containing a name describing the data channel.

Link copied to clipboard

The read-only RTCDataChannel property maxPacketLifeTime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.

Link copied to clipboard

The read-only RTCDataChannel property maxRetransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.

Link copied to clipboard

The read-only RTCDataChannel property negotiated indicates whether the (true) or by the WebRTC layer (false).

Link copied to clipboard

The read-only RTCDataChannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.

Link copied to clipboard

The read-only RTCDataChannel property protocol returns a string containing the name of the subprotocol in use.

Link copied to clipboard

The read-only RTCDataChannel property readyState returns a string which indicates the state of the data channel's underlying data connection.

Functions

Link copied to clipboard
fun close()

The RTCDataChannel.close() method closes the closure of the channel.

Link copied to clipboard
Link copied to clipboard
fun send(data: ArrayBuffer)
fun send(data: Blob)

fun send(data: String)

The send() method of the remote peer.

Link copied to clipboard