gevent-socketio icon indicating copy to clipboard operation
gevent-socketio copied to clipboard

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

Open Marboni opened this issue 12 years ago • 3 comments

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?

Marboni avatar May 25 '13 05:05 Marboni

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" [email protected] 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 .

ander2 avatar May 25 '13 07:05 ander2

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 avatar May 25 '13 07:05 Marboni

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

Marboni avatar Oct 01 '13 11:10 Marboni