You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application that keeps track of connected clients and "locks" editable fields for other clients until there are no other clients trying to access it. The page is "locked" when someone loads the page and establishes a connection with the tornado socket server. Once that user moves to another page or closes the browser/tab the socket server removes them from the dictionary of connected clients so that another client that's waiting can start their workflow.
Testing this functionality over the VPN from home one day led me to find that if I disconnect from the VPN and then close the page or navigate away from the page that establishes a socket connection tornado doesn't seem to call the on_close method. This causes the client to be stored in the dictionary until the socket server is restarted.
Shouldn't tornado be calling on_close upon a disconnect OR an interruption to the connection?
I'm using tornado 4.0.1 with python 3.4.
The text was updated successfully, but these errors were encountered:
Idle connections can be kept open indefinitely without any data passing back and forth, so it's impossible to distinguish a connection that is deliberately left idle from one that has been broken by the loss of some intermediate network path. The only guaranteed way to detect that a connection has failed is to try to send data on it and get a response from the other side. You should send some sort of heartbeat back and forth (perhaps using the WebSocketHandler.ping method), and close the connection if it's been too long since the last heartbeat response.
I have an application that keeps track of connected clients and "locks" editable fields for other clients until there are no other clients trying to access it. The page is "locked" when someone loads the page and establishes a connection with the tornado socket server. Once that user moves to another page or closes the browser/tab the socket server removes them from the dictionary of connected clients so that another client that's waiting can start their workflow.
Testing this functionality over the VPN from home one day led me to find that if I disconnect from the VPN and then close the page or navigate away from the page that establishes a socket connection tornado doesn't seem to call the on_close method. This causes the client to be stored in the dictionary until the socket server is restarted.
Shouldn't tornado be calling on_close upon a disconnect OR an interruption to the connection?
I'm using tornado 4.0.1 with python 3.4.
The text was updated successfully, but these errors were encountered: