method IWebSocketConnection.close
IWebSocketConnection.close(
code?: number,
reason?: string
): void

Closes the connection. Idempotent.

Parameters

optional
code: number

RFC 6455 close code (defaults to 1000)

optional
reason: string

Human-readable close reason

Return Type

void

Usage

import { type IWebSocketConnection } from "common/src/index.ts";