Skip to content

Is this a proper way to delect disconnect inside a loop (socketio.AsyncNamespace) #1171

Answered by miguelgrinberg
4n1qz5skwv asked this question in Q&A
Discussion options

You must be logged in to vote

The disconnect event is invoked when a client disconnects. There is no need for you to repeatedly get the session just to see if that errors out. For example, you can use an Event object in your on_start event handler for each client, which you signal from the disconnect handler.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@4n1qz5skwv
Comment options

Answer selected by 4n1qz5skwv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants