Flashphoner WebSDK timeout on connection issues (Vue.js webapp)

Hello

-Version: 5.2.780 (Amazon AWS)
-WebSDK is 2.0.165


I am building a vue.js webapp and want to generate error messages when trying to connect ty the streaming service in case its not available.

I noticed that only after approx. 15-20 seconds i get the state back from the flashphoner-core.js which i then use to generate my error messages

Code:
Firefox kann keine Verbindung zu dem Server unter wss://..../ aufbauen (flashphoner-core.js:508:12)
The session states i want to get are:

Code:
SESSION_STATUS.ESTABLISHED SESSION_STATUS.DISCONNECTED and SESSION_STATUS.FAILED

How can i decrease the timeout, so that the state is delivered after i.e. 5 seconds of connection attempts?


Best,
Thomas
 

Max

Administrator
Staff member
Good day.
It is possible to set Websocket connection establishing timeout while session creation. To do this, timeout parameter in milliseconds should be passed to createSession function:
Code:
var url = "wss://demo.flashphoner.com:8443";
var tm = 1000;
 
Flashphoner.createSession({urlServer: url, timeout: tm}).on(SESSION_STATUS.ESTABLISHED, function (session) {
    ...
});
In server does not respond in this time, client will receive the SESSION_STATUS.FAILED event.
noticed that only after approx. 15-20 seconds i get the state back from the flashphoner-core.js
Anyway this looks like very bad network if websocket connection cannot be established in 15-20 seconds. Please check the TCP channel quality from client to server using iperf for example.
 
Top