Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the base class for WSProvider

Hierarchy

Index

Constructors

Properties

auth: CXoneAuth
connected: boolean = false
dynamicDirectory: CXoneDynamicDirectory
heartbeatTimer: any
logger: Logger = ...
subscribed: boolean = false
wsService: WSService = ...
wsWorker: any

Methods

  • example
    attemptReconnect({reconnectInterval: 300, reconnectAttempts:4});
    

    Parameters

    • reconnectInfo: WsReconnectInfo

      reconnectIntervalInMs in millisecond, maxReconnectAttempts in number and ws url

    • Optional wsWorker: any

    Returns void

  • close(): void
  • Use to close the web socket worker

    example
    this.close();
    

    Returns void

  • connect(websocketUrl: string, wsWorker?: any): void
  • This function used to make connection with websocket server

    example
    connect('ws://localhost:8089');
    

    Parameters

    • websocketUrl: string
    • Optional wsWorker: any

    Returns void

  • connectSocket(): void
  • Method used to connect the WebSocket

    example
    this.connectSocket();
    

    Returns void

  • initAgentStateSocketWorker(): any
  • Use to initializing the web socket worker and will return the method inside the worker

    example
    this.initAgentStateSocketWorker();
    

    Returns any

  • onClosed(): void
  • onError(): void
  • Method used to receive the WebSocket Error and ReConnect the WebSocket

    example
    onError();
    

    Returns void

  • onOpen(): void
  • Method used to send message websocket worker

    example
    onOpen();
    

    Returns void

  • onReconnectComplete(): void
  • onReconnectSuccess(): void
  • runHeartbeat(): void
  • Use to start heartbeat comment for websocket

    example
    this.runHeartbeat();
    

    Returns void

  • sendMessage(msg: unknown, wsWorker: any): void
  • Method to send to websocket worker

    example
    sendMessage('hi');
    

    Parameters

    • msg: unknown

      message send to websocket

    • wsWorker: any

    Returns void

  • subscribeSearch(subscriptionId: string): void
  • Use to subscribe to search results

    example
    this.subscribeSearch(subscriptionId);
    

    Parameters

    • subscriptionId: string

    Returns void

  • unsubscribeSearch(subscriptionId: string): void
  • Use to unsubscribe from websocket

    example
    this.unsubscribeSearch(subscriptionID);
    

    Parameters

    • subscriptionId: string

    Returns void

Generated using TypeDoc