Hi,
I have an Android App that connects via Websocket (GitHub - endel/NativeWebSocket: 🔌 WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP)) into a NodeJS server running in Docker (just FYI, shouldn’t matter IMO).
Now, when the Android device goes to sleep (by adb shell input keyevent KEYCODE_POWER
via network) it stops receiving commands (“GetState”) what I can see from my logs. As soon as it wakes up (next morning after sleeping all night) it seems the TCP connection is still alive and all “GetState” that should be sent over night from the server are received nearly without delay. This takes about an hour (!) after which the regular interval of the queries can be observed.
Any idea why that happens and how I should workarount this? How should I handle the connection? I would have expected it is closed at latest after two minutes when sleep mode is activated.