abourget / gevent-socketio

Official repository for gevent-socketio
http://readthedocs.org/docs/gevent-socketio/en/latest/
BSD 3-Clause "New" or "Revised" License
1.21k stars 331 forks source link

Disconnect by timeout isn't fired when using xhr-polling #145

Open Marboni opened 11 years ago

Marboni commented 11 years ago

If client doesn't call socket.disconnect() before exit (for example, he closed browser, not tab, or he dropped his laptop to a river), his connection on server will be alive. I tried to send a packet to non-existing user, it doesn't help. Any workarounds?

ander2 commented 11 years ago

Are you receiving the recv_disconnect event on the server? If so, use that event to call the disconnect() function and close the connection. On 2013 mai 25 07:25, "Marboni" notifications@github.com wrote:

If client doesn't call socket.disconnect() before exit (for example, he closed browser, not tab, or he dropped his laptop to a river), his connection on server will be alive. I tried to send a packet to non-existing user, it doesn't help. Any workarounds?

— Reply to this email directly or view it on GitHubhttps://github.com/abourget/gevent-socketio/issues/145 .

Marboni commented 11 years ago

recv_disconnect() isn't called in "xhr-polling" mode. It's a cause of the issue. I see only one way for now - make client emits from time to time and postpone timeout on server when receive them. But it's re-implementing of heartbeat functionality, so it's not so good. Any other solutions?

Marboni commented 11 years ago

Guys, any updates here? I already implemented proposed approach, am I right?