Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICivetWebSocketHandler

Basic interface for a websocket handler. Handlers implementations must be reentrant.

Hierarchy

  • ICivetWebSocketHandler

Index

Methods

handleClose

  • Callback method for when the connection is closed.

    Parameters

    Returns void

handleConnection

  • Callback method for when the client intends to establish a websocket connection, before websocket handshake.

    Parameters

    Returns boolean

    true to keep socket open, false to close it

handleData

  • Callback method for when a data frame has been received from the client.

    Parameters

    • server: CivetServer

      the calling server

    • conn: MgConnection

      the connection information

    • opcode: WebSocketOpCode

      websocket opcode (decoded from bits)

    • fin: boolean

      indicates that this is the final fragment in a message. The first fragment MAY also be the final fragment. (decoded from bits)

    • data: string

      payload, with mask (if any) already applied.

    • bits: number

      first byte of the websocket frame, see websocket RFC at http://tools.ietf.org/html/rfc6455, section 5.2

    Returns boolean

    true to keep socket open, false to close it

handleReadyState

  • Callback method for when websocket handshake is successfully completed, and connection is ready for data exchange.

    Parameters

    Returns void

Generated using TypeDoc