Class WebSocket

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(url: string, subprotocol?: string, settings?: any): WebSocket

Parameters

  • url: string
  • subprotocol?: string optional
  • settings?: any optional

Returns

WebSocket

Properties

public id: string

Methods

public many(event: string, times: number, handler: (data: any) => void, confirmation?: (arg: XSockets.ConfirmationArgument) => void)

Parameters

  • event: string
  • times: number
  • handler: (data: any) => void
  • confirmation?: (arg: XSockets.ConfirmationArgument) => void optional

public on(event: string, handler: (data: any) => void, confirmation?: (arg: XSockets.ConfirmationArgument) => void)

Parameters

  • event: string
  • handler: (data: any) => void
  • confirmation?: (arg: XSockets.ConfirmationArgument) => void optional

public one(event: string, handler: (data: any) => void, confirmation?: (arg: XSockets.ConfirmationArgument) => void)

Parameters

  • event: string
  • handler: (data: any) => void
  • confirmation?: (arg: XSockets.ConfirmationArgument) => void optional

public publish(topic: string, data: any)

Parameters

  • topic: string
  • data: any

public unbind(event: string)

Parameters

  • event: string