Class DataStreamConnection

DataStream connection which holds any necessary state information, encryption and decryption keys, manages protocol handlers and also handles sending and receiving of data stream frames.

Hierarchy

  • EventEmitter
    • DataStreamConnection

Constructors

Properties

remoteAddress: string

Methods

  • Sends a new event message to the connected client.

    Parameters

    • protocol: string

      name of the protocol

    • event: string

      name of the event (also referred to as topic. See Topics for some known ones)

    • message: Record<any, any> = {}

      message dictionary which gets sent along the event

    Returns void

  • Sends a new request message to the connected client.

    Parameters

    • protocol: string

      name of the protocol

    • request: string

      name of the request (also referred to as topic. See Topics for some known ones)

    • message: Record<any, any> = {}

      message dictionary which gets sent along the request

    • callback: ResponseHandler

      handler which gets supplied with an error object if the response didn't arrive in time or the status and the message dictionary from the response

    Returns void

  • Send a new response message to a received request message to the client.

    Parameters

    • protocol: string

      name of the protocol

    • response: string

      name of the response (also referred to as topic. See Topics for some known ones)

    • id: number

      id from the request, to associate the response to the request

    • status: HDSStatus = HDSStatus.SUCCESS

      status indication if the request was successful. A status of zero indicates success.

    • message: Record<any, any> = {}

      message dictionary which gets sent along the response

    Returns void