When the internet connection is down again after being lost one first time, the reseted retryCount value is now taken into account and the retry attempts (socket.connect()) are well delayed in a progressive way (1, 2, 3, 4, ... 15 seconds)
The fix is based on a global value:
let retryCount = 0; // retries count of opening socket attempts
When the internet connection is down again after being lost one first time, the reseted
retryCount
value is now taken into account and the retry attempts (socket.connect()
) are well delayed in a progressive way (1, 2, 3, 4, ... 15 seconds) The fix is based on a global value: