Hierarchy (view full)

Constructors

Properties

name: string

Methods

  • Wait for a binary message.

    Parameters

    • Optionaltimeout: number

      Timeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.

    Returns Promise<Uint8Array>

    The promise will resolve when a value was received. The promise will reject when 1) the timeout expired 2) the connection was closed

  • Wait for an incoming message for a specified period of time.

    Parameters

    • Optionaltimeout: number

      Timeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.

    Returns Promise<any>

    The promise will resolve when a value was received. The value will be the JSON.parsed object. The promise will reject when 1) the timeout expired 2) the connection was closed

  • Wait for an incoming message with a specific type for a specified period of time.

    Parameters

    • type: string

      The type field of the message should have this type.

    • typekey: string = 'type'

      The name of the member that holds the type that is checked for equality with the type param.

    • Optionaltimeout: number

      Timeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.

    Returns Promise<any>

    The promise will resolve when a value was received. The value will be the JSON.parse'd object The promise will reject when 1) the timeout expired 2) the connection was closed 3) the type of the received message doe not match parameter 'type'

  • Wait for an incoming message for a specified period of time.

    Parameters

    • Optionaltimeout: number

      Timeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.

    Returns Promise<string | Uint8Array>

    The promise will resolve when a value was received. The promise will reject when 1) the timeout expired 2) the connection was closed

  • Wait for a string based message.

    Parameters

    • Optionaltimeout: number

      Timeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.

    Returns Promise<string>

    The promise will resolve when a value was received. The promise will reject when 1) the timeout expired 2) the connection was closed