Disconnection detection
Hi! I understand Socket.io sends pings and expects pongs to identify an active connection. For the moment, our server reduced the 25sec ping interval / 60sec ping timeout to a 10s/3s configuration. Still, when airplane mode is activated, it takes a non-deterministic amount of time for the disconnect / reconnect events to be called , while I expected it to take 13s on the worst case scenario. What is even more intriguing is that, once I disconnect(fast: YES) and reconnect afterwards, the offline detection becomes almost instantaneous!
Can someone enlighten me as to why this happen ? Is this behavior after reconnection expected ? Does it increase traffic or overhead in any significant way ?
Thanks for the great library!
I still haven't really thought of a nice way to deal with iOS. Since the library doesn't really care what platform it is, it's depending on the Cocoa frameworks to handle those cases. The other problem is going into the background. It's really up to you to handle changes in network status if you want reliability when it comes to disconnect/reconnect. Unless you have suggestions on how to make it better, while still being platform agnostic.
I see. I opted to disconnect and reconnect manually to handle ios background, that's when I made this strange observation that disconnection is instantly recognized anytime after a manual disconnect-reconnect cycle. I wanted to understand the reason behind that, do you have an idea what it might be?
Regards
Em 12/06/2015, às 11:02, Erik Little [email protected] escreveu:
I still haven't really thought of a nice way to deal with iOS. Since the library doesn't really care what platform it is, it's depending on the Cocoa frameworks to handle those cases. The other problem is going into the background. It's really up to you to handle changes in network status if you want reliability when it comes to disconnect/reconnect. Unless you have suggestions on how to make it better. But still being platform agnostic.
— Reply to this email directly or view it on GitHub.
I see. I opted to disconnect and reconnect manually to handle ios background
That's what I did in the application that I based this client on. As for that behavior, I'm not really sure. The underlying engine (that handles all the networking) is re-added whenever it reconnects.
When you say that disconnection is instantly recognized, do you mean putting it back into airplane mode after manual disconnect/reconnect will instantly trigger the disconnect event, instead of who-knows-when?
Yes, exactly! I still haven't tested on many devices/versions, but on at least 3 ios 8.3 devices it held true ( to my surprise)
Att Rafael Nobre
Em 12/06/2015, às 12:26, Erik Little [email protected] escreveu:
I see. I opted to disconnect and reconnect manually to handle ios background
That's what I did in the application that I based this client on. As for that behavior, I'm not really sure. The underlying engine (that handles all the networking) is re-added whenever it reconnects.
When you say that disconnection is instantly recognized, do you mean putting it back into airplane mode after manual disconnect/reconnect will instantly trigger the disconnect event, instead of who-knows-when?
— Reply to this email directly or view it on GitHub.