-
Notifications
You must be signed in to change notification settings - Fork 331
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 callback not instant #205
Comments
Set a lower connection timeout in your server. |
gevent-socketio/socketio/server.py Lines 37 to 49 in 668d11e
:param heartbeat_interval: int The timeout for the server, we
should receive a heartbeat from the client within this
interval. This should be less than the
``heartbeat_timeout``.
:param heartbeat_timeout: int The timeout for the client when
it should send a new heartbeat to the server. This value
is sent to the client after a successful handshake.
:param close_timeout: int The timeout for the client, when it
closes the connection it still X amounts of seconds to do
re open of the connection. This value is sent to the
client after a successful handshake. |
Yes it works with that option lowered. Thanks @gordol |
No problem, just keep in mind, as you scale and have more users, the increased frequency of those heartbeats will lead to more traffic, and also on some mobile networks, there may be quite a bit of latency that will cause users to become disconnected by mistake if you set the interval too low. Computationally, and in terms of bandwidth, re-negotiation of a connection is heavier and more resource intensive than waiting a few extra seconds for a client time-out. But, it's really a micro-optimization, at this point. Just things to consider later if/when you're scaling... Best of luck! |
@gordol |
Disconnect callback is not called instantly on client (browser) close. Rather it takes few seconds.
What can be best way, if possible to know instantly when client disconnects?
The text was updated successfully, but these errors were encountered: