Setu-TS
    Preparing search index...

    Interface IWebSocketTransport

    The runtime-native socket, normalized to the two operations the framework needs. Implemented by each HTTP adapter's upgrader over its platform socket (Deno.upgradeWebSocket's WebSocket, a ws socket on Node, Bun's ServerWebSocket, the server half of a Workers WebSocketPair).

    0.2.0

    interface IWebSocketTransport {
        readyState: WebSocketReadyState;
        close(code?: number, reason?: string): void;
        send(data: string | Uint8Array<ArrayBufferLike>): void;
    }
    Index

    Current lifecycle state of the underlying socket.

    • Closes the socket.

      Parameters

      • Optionalcode: number

        RFC 6455 close code (defaults to 1000)

      • Optionalreason: string

        Human-readable close reason

      Returns void

    • Sends a frame to the peer. A string is sent as a text frame, a Uint8Array as a binary frame.

      Parameters

      • data: string | Uint8Array<ArrayBufferLike>

        The frame payload

      Returns void