Hy all . I have a problem with my application . The basic is that i need to know real-time who is online and who is not . When the user close his windows or press close connection button from client , the onDisconnect() method from the server is called . The problem is when he unplug his network cable or shut down his computer . In this case the onDisconnect() method from the server is not called any more . What should i use in this case ? Can anyone help me with this problem ? Thaks . Cheers , Adrian !!
Yup... it's an ugly problem. It seems to happen when users are connecting through a proxy as well. What I do is have each client all a function on the server side every 5 seconds that updates a client variable with the time of the call. I then have a function (on the server side) that runs through the clients every 5 seconds to compare each client's last update time to the current time. If a client hasn't updated in the last 10 seconds, the function calls the onDisconnect for the client.
Yes , it's a good ideea . But if the client unplug his cable , the server can't call any onDisconnect function from client , and in my master application he still figures as online . Do you have a solution to work this arround ? Thanks .
I think you misunderstood me.
Ok . Got it now . I'll try this method . Thanks a lot Jay . I'll let you know if i have any problem with this .
Don't see what you're looking for? Try a search.
|