HomeGuidesAPI Reference
HubBlogChangelogSupport ForumLog In
API Reference

Node.js SDK - RainwayConnection

Home > @rainway/native > RainwayConnection

RainwayConnection class

A connection to the Rainway network over which peer connection requests are transmitted.

Signature:

export declare class RainwayConnection extends EventEmitter<RainwayConnectionEvents> 

Extends: EventEmitter<RainwayConnectionEvents>

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 RainwayConnection class.

Properties

PropertyModifiersTypeDescription
externalIdstringThe optional user-specified string identifying the local peer.
idBigIntA numeric ID identifying the local peer. A Peer ID identifies a Rainway peer to other peers.
peersReadonlyArray<Peer>List of peers connected via this Rainway connection.

Methods

MethodModifiersDescription
close()Destroys the Rainway network connection, including all sub resources.
connect(options)Connect to another peer on the Rainway Network.