Home > rainway-sdk-native > Peer
Peer class
A Rainway Peer which is connected to us. These are cached statically and will be automatically cleaned up on disconnect.
Signature:
export declare class Peer
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
externalId | string | ||
id | PeerId | ||
information | PeerInformation | undefined | Gets the information for this guest. | |
requestId | string |
Methods
Method | Modifiers | Description |
---|---|---|
createDataChannel(name, mode) | Create a new custom user data channel with a specific peer. This is only valid if we were the one who initiated the connection. | |
disconnect() | Disconnect this peer. | |
disconnectAll() | static | Disconnect all peers. |
get(id) | static | Looks up a peer by id and returns undefined if the peer is unknown. As peers are registered when they disconnect, a peer you think exists may no longer be present. |
getAssert(id) | static | Get a given Peer by its ID. Asserts that the peer exists and never returns null. |
purge(id) | static | Remove a given peer from the cache. You should not need to call this unless you want to force a refresh of peer information. |
send(channel, msg) | Sends a message to the specified guest. | |
setPermissions(stream, inputLevel) | Sets the stream config for this Peer. |