Home Reference Source Test
public class | source

Network

Extends:

Observable → Network

Constructor Summary

Public Constructor
public

constructor(blockchain: IBlockchain, networkConfig: NetworkConfig, time: Time)

Member Summary

Public Members
public get
public set

allowInboundConnections(allowInboundConnections: boolean)

public get
public get

bytesReceived: number

public get

bytesSent: number

public get
public get
public get
public get

peerCount: number

public get
public get

peerCountDumb: number

public get

peerCountWebRtc: number

public get
public get
public get

Method Summary

Public Methods
public

connect(): void

public

disconnect(reason: string | *): void

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(blockchain: IBlockchain, networkConfig: NetworkConfig, time: Time) source

Override:

Observable#constructor

Params:

NameTypeAttributeDescription
blockchain IBlockchain
networkConfig NetworkConfig
time Time

Listen:

*

PeerAddressBook#added

*

ConnectionPool#peer-joined

*

ConnectionPool#peer-left

*

ConnectionPool#peers-changed

*

ConnectionPool#recycling-request

*

ConnectionPool#connect-error

Public Members

public get addresses: PeerAddressBook source

public set allowInboundConnections(allowInboundConnections: boolean) source

public get allowInboundConnections: boolean source

public get bytesReceived: number source

public get bytesSent: number source

public get config: NetworkConfig source

public get connections: ConnectionPool source

public get knownAddressesCount: number source

public get peerCount: number source

public get peerCountConnecting: number source

public get peerCountDumb: number source

public get peerCountWebRtc: number source

public get peerCountWebSocket: number source

public get peerCountWebSocketSecure: number source

public get time: Time source

Public Methods

public connect(): void source

Return:

void

public disconnect(reason: string | *): void source

Params:

NameTypeAttributeDescription
reason string | *

Return:

void

public disconnectWebSocket() source