Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IWebSocket

An abstraction that enables reuse of the `WebSocketChannel class in the frontend and backend independent of the actual underlying socket implementation.

Hierarchy

  • IWebSocket

Index

Methods

  • close(): void
  • isConnected(): boolean
  • onClose(cb: ((reason: string, code?: number) => void)): void
  • Listener callback to handle close events (Remote side).

    Parameters

    • cb: ((reason: string, code?: number) => void)

      The callback.

        • (reason: string, code?: number): void
        • Parameters

          • reason: string
          • Optional code: number

          Returns void

    Returns void

  • onError(cb: ((reason: any) => void)): void
  • onMessage(cb: ((message: Uint8Array) => void)): void
  • send(message: Uint8Array): void