Home > @rainway/web > Peer > createDataChannel
Create a new data channel for exchanging application-level data with this peer. The returned
Promise resolves once the new data channel has been opened.
If an error prevents the channel from being created or opened, the promise rejects with a
As a rule, the party that requested the peer-to-peer connection should create the data channels. This means you should call this function on a RainwayPeer you get from
RainwayConnection.connect, and not elsewhere.
createDataChannel(options: OpenDataChannelOptions): Promise<DataChannel>;
|options||OpenDataChannelOptions||A name and mode for the data channel.|
- A DataChannel object, once it is opened.