setInterval(function(){
socket.emit("stayalive", { "room": room });
}, 5000);
I have developed a simple browser application with an interval function that is currently running on my phone. I am using Chrome on my Nexus 4 for debugging purposes. However, I have encountered an issue where the interval stops after approximately 5 minutes when I lock the phone, leading to disconnection from the socket io server.
Interestingly, when I keep the screen unlocked, the interval continues running without any interruptions, and the phone remains connected to the server.
12:29:10 - First interval
12:34:27 - Last incoming interval
12:35:52 - Client disconnected from Server
I am curious if this behavior is related to an Android feature that kills intervals after 5 minutes when the phone is locked. My friends who are using different devices also seem to experience the same problem.
Despite using Chrome on my Nexus 4, it appears that users with various devices encounter similar issues.