Open rts-ssoundar619 opened 7 years ago
you can try with javascript, something like this
var useridtest = 5;
function idleUser() {
var t;
window.onload = rst;
window.onmousemove = rst;
window.onmousedown = rst;
window.onclick = rst;
window.onscroll = rst;
window.onkeypress = rst;
function action() {
// window.location.href = 'logout.php';
alert('idle use rid test ='+useridtest);
}
function rst() {
clearTimeout(t);
t = setTimeout(action, 10000); // time is in milliseconds 300000 = 5 min
}
}
idleUser();
I want to disconnect idle clients from the server. I am using android application as a client and sending data's from the server to client. If internet disconnects on the mobile the client will not send close to server. How can I find out the idle clients and disconnect it.