Class wsc.DataSender
Exposes the capability of a DataTransfer to send raw data over a data channel.
Constructor Attributes | Constructor Name and Description |
---|---|
Instance created by DataTransfer.
|
Method Attributes | Method Name and Description |
---|---|
send(data)
Send raw data by RTCDataChannel in the DataTransfer object.
|
Class Detail
wsc.DataSender()
Instance created by DataTransfer. An object of this class is created by
DataTransfer and set to the member dataSender.
An instance of this class can be obtained by calling {DataTransfer.getSender()} of a DataTransfer object.
An instance of this class can be obtained by calling {DataTransfer.getSender()} of a DataTransfer object.
- See:
- wsc.DataTransfer
Method Detail
send(data)
Send raw data by RTCDataChannel in the DataTransfer object.
The exception when sending data by RTCDataChannel, it will be throw out to application to handle it.
For blob data blob = new Blob([myField.value]); dataSender.send(blob); For a text String dataSender.send("Hello");
- Parameters:
- data
- DOM string, Blob raw data, ArrayBuffer, or ArrayBufferView object to be sent
- Throws:
- Exception The exception thrown out by RTCDataChannel, when sending data with the data channel.