Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SocketWrapper

A thin wrapper around isomorphic-ws' WebSocket class that adds

  • constant message/error/open/close handlers
  • explict connection via a connect() method
  • type support for events
  • handling of corner cases in the open and close behaviour

Hierarchy

  • SocketWrapper

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SocketWrapper(url: string, messageHandler: function, errorHandler: function, openHandler?: undefined | function, closeHandler?: undefined | function, timeout?: number): SocketWrapper

Properties

connected

connected: Promise<void>

Methods

connect

  • connect(): void
  • returns a promise that resolves when connection is open

    Returns void

disconnect

  • disconnect(): void
  • Closes an established connection and aborts other connection states

    Returns void

send

  • send(data: string): Promise<void>

Generated using TypeDoc