Setu-TS
    Preparing search index...

    Interface WebSocketHandlers

    The lifecycle callbacks an application supplies per WebSocket route.

    Every callback may be async; a rejected promise is routed to WebSocketHandlers.onError rather than becoming an unhandled rejection.

    0.2.0

    interface WebSocketHandlers {
        onClose?(
            conn: IWebSocketConnection,
            event: WebSocketCloseEvent,
        ): void | Promise<void>;
        onError?(conn: IWebSocketConnection, error: Error): void | Promise<void>;
        onMessage?(
            conn: IWebSocketConnection,
            data: string | Uint8Array<ArrayBufferLike>,
        ): void | Promise<void>;
        onOpen?(
            conn: IWebSocketConnection,
            context: WebSocketConnectionContext,
        ): void | Promise<void>;
    }
    Index