This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

RTCDataChannel

Summary

Represents a bi-directional data channel between two peers.

Properties

binaryType
Returns the value to which it was last set; on creation, must be initialized to the string "blob".
bufferedAmount
Returns the number of bytes of application data that have been queued using send() but that (as of the last time the event loop started executing a task) have not yet been transmitted to the network.
label
A unique identifier that can be used to distinguish this RTCDataChannel object from other RTCDataChannel objects.
onclose
An event listener to be called when an RTCDataChannel is closed.
onerror
An event listener to be called when an error occurs.
onmessage
An event listener to be called when a message is received.
onopen
An event listener to be called when an RTCDataChannel is opened.
readyState
Represents the state of the RTCDataChannel object.
reliable
Returns true if the RTCDataChannel is reliable, and false otherwise.

Methods

close
Closes the RTCDataChannel.
send
Sends a message (data) on the RTCDataChannel’s underlying data transport.

Events

No events.

Related specifications

W3C Web RTC Specification
W3C Editor’s Draft