Builder for websockets.

Hierarchy

  • WebsocketBuilder

Constructors

Properties

_options?: WebsocketOptions
_protocols?: string | string[]
_url: string

Accessors

  • get buffer(): undefined | WebsocketBuffer<string | ArrayBufferLike | ArrayBufferView | Blob>
  • Getter for the buffer.

    Returns undefined | WebsocketBuffer<string | ArrayBufferLike | ArrayBufferView | Blob>

    the buffer, undefined if no buffer has been set

  • get instantReconnect(): undefined | boolean
  • Getter for wether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.

    Returns undefined | boolean

    wether to reconnect immediately after a connection has been lost, undefined if no value has been set

  • get maxRetries(): undefined | number
  • Getter for the maximum number of retries before giving up.

    Returns undefined | number

    the maximum number of retries before giving up, undefined if no maximum has been set

  • get protocols(): undefined | string | string[]
  • Getter for the protocols.

    Returns undefined | string | string[]

    the protocols, undefined if no protocols have been set

Methods

  • Sets wether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.

    Parameters

    • instantReconnect: undefined | boolean

      wether to reconnect immediately after a connection has been lost

    Returns WebsocketBuilder

  • Adds protocols to the websocket. Subsequent calls to this method will override the previously set protocols.

    Parameters

    • protocols: undefined | string | string[]

      the protocols to add

    Returns WebsocketBuilder

Generated using TypeDoc