wrtc.onWebsocket() is called when a socket object has opened or closed a websocket connection to IXNX server, or if a websocket open failed.
Some websocket fails result in wrtc.onError() event function calls instead.
You can use this event function to alert user of internet connection problems (if websocket connection fails with "FAIL-SLOW" or "FAIL-FAST", see below).
Websocket connection to IXNX server is opened, closed or failed.
wrtc.onWebsocket(socket, arg)
A fast fail may be sign of IXNX server overload. To reduce risk of further overloading a random additional delay (of 10-40 sec) is added by wrtc_kit before it attempts to open a websocket connection again. If your server handles more than a few thousands of clients you might need to adjust this additional delay by altering the value of socket.additionalWaitBeforeNextWsOpen in your wrtc.onWebsocket() function, to make retries be delayed a random number of seconds when IXNX server reports a FAIL-FAST overload. You might for instance delay retries more while your client is idle, but make quicker retries while in a call.
This kind of additional delay is only needed for very large installations.