Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • WebSocketConnection

Index

Constructors

constructor

Properties

app

isConnected

isConnected: Observable<boolean>

maxMessageQueueLength

maxMessageQueueLength: number

The maximum number of messages to queue up to send to the server on reconnect.

reconnectionGrowthFactor

reconnectionGrowthFactor: number

The growth rate between retry attempts. The time to the next connection attempt is the time to the previous reconnection attempt multiplied by the growth factor.

reconnectionMax

reconnectionMax: number

The maximum number of milliseconds between retry attempts.

reconnectionMin

reconnectionMin: number

The minimum number of milliseconds between retry attempts.

Methods

command

  • Get a command object that can be used to send commands to the server.

    Parameters

    • name: string

    Returns WebSocketCommand

connect

  • connect(connectionString: string): void
  • Connect to the given server. This should only be called once. Disconnecting and connecting to another server is not supported because I don't see any use for it.

    Parameters

    • connectionString: string

    Returns void

sendMessage

  • Send a raw message to the server. Not generally recommended. Use command(name).execute() instead.

    Parameters

    • message: OutgoingMessage

      The message object to send to the server.

    • Optional options: SendMessageOptions

      Options. If not specified all values are default. See the interface for more information.

    Returns void

Static hasBrowserSupport

  • hasBrowserSupport(): boolean
  • Check whether the browser supports the web socket

    Returns boolean