Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AsyncWebSocket

The WebSockedAsPromised class.

Hierarchy

  • AsyncWebSocket

Index

Constructors

constructor

  • new AsyncWebSocket(url: string, allowSelfSigned: boolean): AsyncWebSocket
  • Constructor. Unlike original WebSocket it does not immediately open connection. Please call open method to connect.

    Parameters

    • url: string

      WebSocket URL.

    • allowSelfSigned: boolean

      Whether the server certificate is not verified against the list of supplied CAs. Allow connection to servers with self signed certificates.

    Returns AsyncWebSocket

Accessors

isClosed

  • get isClosed(): boolean

isClosing

  • get isClosing(): boolean

isOpened

  • get isOpened(): boolean

isOpening

  • get isOpening(): boolean

Methods

close

  • close(code?: undefined | number): Promise<void>
  • Closes WebSocket connection.

    Parameters

    • Optional code: undefined | number

    Returns Promise<void>

open

  • open(): Promise<void>

send

  • send(...data: any[]): Promise<IReply>
  • Returns promised which will be satisfied when the reply is received.

    Parameters

    • Rest ...data: any[]

      The data to send.

    Returns Promise<IReply>

waitForServer

  • waitForServer(): Promise<IReply>
  • Waits for reply which is not requested by Send. The replies are filtered by the replyId.

    Returns Promise<IReply>

Generated using TypeDoc