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
Is your feature request related to a problem? Please describe.
Client logic that works with connects and reconnects may knot always know what the state of the connection is.
It is convenient to be able to check if a namespace is connected or disconnected. The javascript version of the library has a connected property on the connection.
Describe the solution you'd like
a function querying the status of a connection would be useful. Namespaces shoudld be supported.
so:
defget_state(self.namespace=""):
# return "connected", "disconnected", "reconnecting" based on internal logic.
Such a method should also exist on the namespace class.
The text was updated successfully, but these errors were encountered:
The sio.connected attribute can be used to determine if the client is connected or disconnected/reconnecting. There is currently no distinction between a disconnected client and a client that is attempting to reconnect after the connection dropped. The sio.namespaces set contains the connected namespaces.
Thanks. I guess I can determine the local reconnect state from whether the sio.wait() has returned or not.
Incidentally, I have an outer loop for the initial connect, performing the same kind of retry/backoff logic as the documented behaviour of the internal reconnect. I find that the internal reconnect sometimes failes (and sio.wait() exits) if a server responds with a 404 during a re-connection attempt, which can happen for example during a server update cycle.
There are a couple of issues related to the reconnect not working in certain conditions: #485 and miguelgrinberg/python-engineio#254. Currently working on these.
Is your feature request related to a problem? Please describe.
Client logic that works with connects and reconnects may knot always know what the state of the connection is.
It is convenient to be able to check if a namespace is connected or disconnected. The javascript version of the library has a
connected
property on the connection.Describe the solution you'd like
a function querying the status of a connection would be useful. Namespaces shoudld be supported.
so:
Such a method should also exist on the namespace class.
The text was updated successfully, but these errors were encountered: