Home Reference Source Test
public class | source

PeerAddressBook

Extends:

Observable → PeerAddressBook

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get
public get
public get
public get
public get

seeded: boolean

Method Summary

Public Methods
public

add(channel: PeerChannel, arg: PeerAddress | Array<PeerAddress>)

public

close(channel: PeerChannel, peerAddress: PeerAddress, type: number | null): void

Called when a connection to this peerAddress is closed.

public

established(channel: PeerChannel, peerAddress: PeerAddress | RtcPeerAddress): void

Called when a connection to this peerAddress has been established.

public

get(peerAddress: PeerAddress): PeerAddress | null

public

getByPeerId(peerId: PeerId): PeerAddress | null

public
public
public

isBanned(peerAddress: PeerAddress): boolean

public

iterator(): Iterator<PeerAddressState>

public

query(protocolMask: number, serviceMask: number, maxAddresses: number): Array<PeerAddress>

public
public

unroutable(channel: PeerChannel, peerAddress: PeerAddress): void

Called when a message has been returned as unroutable.

public
public

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise | null

public

off(type: string, id: number)

public

on(type: string, callback: Function): number

Public Constructors

public constructor(netconfig: NetworkConfig) source

Override:

Observable#constructor

Params:

NameTypeAttributeDescription
netconfig NetworkConfig

Public Members

public get knownAddressesCount: number source

public get knownRtcAddressesCount: number source

public get knownWsAddressesCount: number source

public get knownWssAddressesCount: number source

public get seeded: boolean source

Public Methods

public add(channel: PeerChannel, arg: PeerAddress | Array<PeerAddress>) source

Params:

NameTypeAttributeDescription
channel PeerChannel
arg PeerAddress | Array<PeerAddress>

public close(channel: PeerChannel, peerAddress: PeerAddress, type: number | null): void source

Called when a connection to this peerAddress is closed.

Params:

NameTypeAttributeDescription
channel PeerChannel
peerAddress PeerAddress
type number | null

Return:

void

public established(channel: PeerChannel, peerAddress: PeerAddress | RtcPeerAddress): void source

Called when a connection to this peerAddress has been established. The connection might have been initiated by the other peer, so address may not be known previously. If it is already known, it has been updated by a previous version message.

Params:

NameTypeAttributeDescription
channel PeerChannel
peerAddress PeerAddress | RtcPeerAddress

Return:

void

public get(peerAddress: PeerAddress): PeerAddress | null source

Params:

NameTypeAttributeDescription
peerAddress PeerAddress

Return:

PeerAddress | null

public getByPeerId(peerId: PeerId): PeerAddress | null source

Params:

NameTypeAttributeDescription
peerId PeerId

Return:

PeerAddress | null

public getChannelByPeerId(peerId: PeerId): PeerChannel source

Params:

NameTypeAttributeDescription
peerId PeerId

Return:

PeerChannel

public getState(peerAddress: PeerAddress): PeerAddressState source

Params:

NameTypeAttributeDescription
peerAddress PeerAddress

Return:

PeerAddressState (nullable: true)

public isBanned(peerAddress: PeerAddress): boolean source

Params:

NameTypeAttributeDescription
peerAddress PeerAddress

Return:

boolean

public iterator(): Iterator<PeerAddressState> source

Return:

Iterator<PeerAddressState>

public query(protocolMask: number, serviceMask: number, maxAddresses: number): Array<PeerAddress> source

Params:

NameTypeAttributeDescription
protocolMask number
serviceMask number
maxAddresses number

Return:

Array<PeerAddress>

public rtcIterator(): Iterator<PeerAddressState> source

Return:

Iterator<PeerAddressState>

public unroutable(channel: PeerChannel, peerAddress: PeerAddress): void source

Called when a message has been returned as unroutable.

Params:

NameTypeAttributeDescription
channel PeerChannel
peerAddress PeerAddress

Return:

void

public wsIterator(): Iterator<PeerAddressState> source

Return:

Iterator<PeerAddressState>

public wssIterator(): Iterator<PeerAddressState> source

Return:

Iterator<PeerAddressState>