Skip to main content

Class: Transport

Hierarchy

  • client

    Transport

Constructors

constructor

new Transport(reconnectTimeout?): Transport

Parameters

NameType
reconnectTimeout?number

Returns

Transport

Overrides

WebSocket.constructor

Properties

MessageTypes

Static MessageTypes: typeof Type = Message.Type


connection

connection: connection


onAction

Optional onAction: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onChat

Optional onChat: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onEntity

Optional onEntity: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onError

Optional onError: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onEvent

Optional onEvent: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onInit

Optional onInit: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onJoin

Optional onJoin: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onLeave

Optional onLeave: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onLoad

Optional onLoad: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onMethod

Optional onMethod: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onPeer

Optional onPeer: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onTransport

Optional onTransport: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onUnload

Optional onUnload: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


onUpdate

Optional onUpdate: (event: MessageProtocol) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageProtocol
Returns

void


reconnectTimeout

Optional reconnectTimeout: number

Methods

connect

connect(address, secret): Promise<void>

Parameters

NameType
addressstring
secretstring

Returns

Promise<void>

Overrides

WebSocket.connect


decodeSync

decodeSync(buffer): MessageProtocol

Parameters

NameType
bufferany

Returns

MessageProtocol


encodeSync

encodeSync(message): Uint8Array

Parameters

NameType
messageany

Returns

Uint8Array


send

send(event): void

Parameters

NameType
eventMessageProtocol

Returns

void


tryReconnect

tryReconnect(): void

Returns

void