Skip to main content

IQWebSocketConnection

@quik/websocket


@quik/websocket / IQWebSocketConnection

Interface: IQWebSocketConnection

Defined in: websocket/src/types.ts:21

Minimal connection adapter used by the heartbeat service.

Properties

id

id: string

Defined in: websocket/src/types.ts:23

Unique connection identifier.

Methods

close()

close(code?, reason?): void

Defined in: websocket/src/types.ts:38

Closes the connection.

Parameters

code?

number

WebSocket close code.

reason?

string

Optional close reason.

Returns

void


isOpen()

isOpen(): boolean

Defined in: websocket/src/types.ts:25

Returns true when the connection can send frames.

Returns

boolean


send()

send(data): void

Defined in: websocket/src/types.ts:31

Sends a text frame.

Parameters

data

string

Serialized payload.

Returns

void


terminate()?

optional terminate(): void

Defined in: websocket/src/types.ts:40

Forcefully terminates the connection when supported by the adapter.

Returns

void