Home Manual Reference Source Repository
import SignalingGate from 'netflux/src/SignalingGate.js'
public class | source

SignalingGate

This class represents a door of the WebChannel for the current peer. If the door is open, then clients can join the WebChannel through this peer. There are as many doors as peers in the WebChannel and each of them can be closed or opened.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Method Summary

Public Methods
public

close()

Close the door if it is open and do nothing if it is closed already.

public

Get open data.

public

Check if the door is opened or closed.

public

open(url: string, onChannel: function(ch: RTCDataChannel), key: string): Promise<OpenData, string>

Open the gate.

Public Constructors

public constructor(wc: WebChannel) source

Params:

NameTypeAttributeDescription
wc WebChannel

Public Members

public webChannel: WebChannel source

Public Methods

public close() source

Close the door if it is open and do nothing if it is closed already.

public getOpenData(): OpenData | null source

Get open data.

Return:

OpenData | null

Open data if the door is open and null otherwise

public isOpen(): boolean source

Check if the door is opened or closed.

Return:

boolean

Returns true if the door is opened and false if it is closed

public open(url: string, onChannel: function(ch: RTCDataChannel), key: string): Promise<OpenData, string> source

Open the gate.

Params:

NameTypeAttributeDescription
url string

Signaling server url

onChannel function(ch: RTCDataChannel)
key string

Return:

Promise<OpenData, string>