Setu-TS
    Preparing search index...

    Interface WebSocketEventSink

    The callbacks an HTTP adapter drives once it has completed a handshake. The WebSocket plugin builds one sink per accepted upgrade and hands it to the adapter inside the accept decision; the adapter binds its native socket events to these methods.

    This is the inversion that keeps runtime differences out of the plugin: the adapter knows how to listen, the sink knows what to do.

    0.2.0

    interface WebSocketEventSink {
        onClose(event: WebSocketCloseEvent): void;
        onError(error: Error): void;
        onMessage(data: string | Uint8Array<ArrayBufferLike>): void;
        onOpen(transport: IWebSocketTransport): void;
    }
    Index
    • Called for every inbound frame.

      Parameters

      • data: string | Uint8Array<ArrayBufferLike>

        Text frames arrive as string, binary frames as Uint8Array

      Returns void