socket.io-client-dart
socket.io-client-dart copied to clipboard
Doesn't autoreconnect when going in/out of airplane mode (flutter)
I set "reconnection" to true..according to code, reconnectionAttempts are infinity. After going in airplane mode, I see one reconnect attemp and that's it. After going out of airplane mode, sockets are not connected anymore. That means, a user loses connection even briefly, the app becomes detached from the server and the app doesn't work as intended.
I fear this might also be a problem if an app has been too long in background mode?
@mlp1802 Have you tried to set pingTimeout and pingInterval?
For example:
Socket socket = io(URL, <String, dynamic>{
'pingTimeout': 5000,
'pingInterval': 10000,
});