Skip to content

Latest commit

 

History

History
172 lines (93 loc) · 2.9 KB

SocketClient.md

File metadata and controls

172 lines (93 loc) · 2.9 KB

Class: SocketClient

Table of contents

Properties

Accessors

Methods

Properties

_server

Private _server: Server

Defined in

SocketClient.ts:20


data

data: unknown

Custom data associated with this client. You may set this to anything.

Defined in

SocketClient.ts:40


onClose

onClose: () => void

Type declaration

▸ (): void

Returns

void

Defined in

SocketClient.ts:43


onError

onError: () => void

Type declaration

▸ (): void

Returns

void

Defined in

SocketClient.ts:44


onMessage

onMessage: (event: string | number, data: unknown) => void

Type declaration

▸ (event, data): void

Parameters
Name Type
event string | number
data unknown
Returns

void

Defined in

SocketClient.ts:42

Accessors

id

get id(): number

Returns

number

Defined in

SocketClient.ts:22


transport

get transport(): ITransport

Returns

ITransport

Defined in

SocketClient.ts:26

Methods

close

close(): void

Disconnects this client

Returns

void

Defined in

SocketClient.ts:58


send

send(event, data): void

Sends a message to this client

Parameters

Name Type Description
event unknown Unique identifier for this event. It is best to use a string or number for this, but you can use any type that can be serialized. Recommended type is uint8 (any number between 0 and 255).
data unknown Data that will be sent to this client.

Returns

void

Defined in

SocketClient.ts:75