Home > @rainway/web > DataChannel
DataChannel class
Represents a data channel between oursevles and a remote peer
Signature:
export declare class DataChannel extends EventEmitter<DataChannelEvents>
Extends: EventEmitter<DataChannelEvents
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
id | readonly | string | The unique identifier for this data channel. |
mode | readonly | DataChannelMode | The mode for this data channel. |
peer | readonly | Peer | The |
Methods
Method | Modifiers | Description |
---|---|---|
request(data) | Transmits data to the remote peer and awaits a response. If the data is a string, it will be encoded and sent as UTF-8. | |
send(data) | Transmits data to the remote peer. If the data is a string, it will be encoded and sent as UTF-8. |