Table of Contents

adv.additionalWaitBeforeNextWsOpen

socket.adv.additionalWaitBeforeNextWsOpen is a number property containing number of seconds to delay before next attempt to open a failed websocket connection.

It needs to be used only for very large installations with tens and hundreds of thousands of users connecting to the same IXNX unit.

Value

Number of extra seconds to wait before reconnection attempt.

Default value

0

Usage

socket.adv.additionalWaitBeforeNextWsOpen can be set by code handling event wrtc.onEvent(socket, wrtc.event.ws_open_failed, "FAST"). Value is reset to zero for each new event.

In extremely large installations you may set this property to a random value to allow reconnects be spread out in time, to avoid overloading the IXNX server.

Example

wrtc.onEvent(obj, type, arg) {
  switch(type) {
  ...
  case wrtc.event.ws_open_failed :
      if ((arg === "FAST") && (navigator.onLine))
        obj.adv.additionalWaitBeforeNextWsOpen = Math.floor(10.0 + 30.0 * Math.random());
    break;
  ...
  }
}