Home > @rainway/native > Peer
Peer class
An object representing a connection to a remote Rainway peer.
Signature:
export declare class Peer extends EventEmitter<PeerEvents>
Extends: EventEmitter<PeerEvents>
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Peer class.
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| connection | RainwayConnection | The connection from which this peer was created. | |
| dataChannels | ReadonlyMap<string, DataChannel> | A map from channel ids (labels) to Data Channels opened between us and this peer. | |
| externalId | string | A string identifying this peer in your organization. For example: the "username" of the peer. | |
| id | BigInt | This peer's Rainway id. | |
| outboundStreams | ReadonlyMap<number, OutboundStream> | A map from Stream IDs to active streams associated with this peer. | |
| state | RainwayPeerState | The peer's network connectivity state. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| close() | Destroys the peer connection, including all sub resources. | |
| createDataChannel(options) | Creates a data channel. |
