In async server is not possible to disconnect client while sending him error message? #805
Replies: 3 comments 10 replies
-
Yes, the Error packet is the mechanism to deliver errors to the client, which is then supposed to end the connection. I'm not sure there is a proper way to do it the way you suggest, but I'm open to improving this. The tricky part is to find a way to do this for HTTP and WebSocket, and make sure other Socket.IO implementations work well and are able to expose the error to the client application. Also, please don't write bugs against this package when you need to discuss. This is what "Discussions" is for. |
Beta Was this translation helpful? Give feedback.
-
This is stripped version of running and working code |
Beta Was this translation helpful? Give feedback.
-
I found a way to safely close the connection: thank you for assistance |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I`m using asyncServer implementation.
I want to validate JWT token from the client and if it is not valid, disconnect him with the error message being sent to him.
Is it not possible?
In my current implementation, i`m throwing
raise ConnectionRefusedError('Close')
I've assumed that this should send "Close" message and disconnect the connection.
But instead, it just sending to the client error message " Error:Close"
Version being used 5.4.0
Python 3.8
Beta Was this translation helpful? Give feedback.
All reactions