Skip to content

Connection.default

km127pl edited this page Aug 13, 2023 · 1 revision

Class: default

Connection.default

A TCP socket connection to the server.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new default(socket, server)

Parameters

Name Type
socket Socket
server default

Defined in

Connection.ts:45

Properties

#state

Private #state: State = Connection.State.NONE

The state of the connection.

Defined in

Connection.ts:25


id

Readonly id: string

A unique identifier for this connection.

Defined in

Connection.ts:13


server

Readonly server: default

The server to which this connection belongs.

Defined in

Connection.ts:21


socket

Readonly socket: Socket

The TCP socket for this connection.

Defined in

Connection.ts:17

Accessors

connected

get connected(): boolean

Whether this connection is connected (i.e. it can send and receive data).

Returns

boolean

Defined in

Connection.ts:76


state

get state(): State

The state of the connection.

Returns

State

Defined in

Connection.ts:30

Methods

disconnect

disconnect(reason?): Promise<boolean>

Disconnect this connection.

Parameters

Name Type Description
reason? string The reason for the disconnect.

Returns

Promise<boolean>

Defined in

Connection.ts:69

Clone this wiki locally