You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 13, 2024. It is now read-only.
// connection is made and all of a sudden server is down, two things happen -> we send ping to server repeatedly and check fo response -> if response received for that no. of attempts meaning server got up if not meaning server down show msg
107
-
// fe side, we send pings to keep ws alive, but when server goes down ping gives no response which causes ws to close
108
-
// In this case, we need to check the cause of closure
109
-
// To check if reason is server down, we need to make new ws, send pings if no response recieved ws may close on its own so we send again for x amount times
110
-
// once all attempts get exhausted, we conclude that server is down and show message
111
-
// but if in one of the attempts, server send back a request - we try to reconnect (how to reconnect?)
112
-
// handles reconnection if server goes down
113
-
// 1. triggers on connection closed -> 1. reattempt to connect first check if server is up -> ping 4-5 times, 2. if server down for long time show msg, 3. if server back up re-establish websocket connection
114
-
115
-
// trigger this function when socket is closed -> to check if server is down
116
-
publiccheckServerStatus(){
117
-
console.log('checkServerStatus');
118
-
119
-
// open new socket
120
-
this.createNewWebsocket();
121
-
122
-
// if WS is open, ping server for sometime, arbitary tries
0 commit comments