Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect idle clients #103

Open
rts-ssoundar619 opened this issue Jul 28, 2017 · 1 comment
Open

Disconnect idle clients #103

rts-ssoundar619 opened this issue Jul 28, 2017 · 1 comment

Comments

@rts-ssoundar619
Copy link

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.

@petrospap
Copy link

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants