-
-
Notifications
You must be signed in to change notification settings - Fork 586
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Error trying to disconnect #568
Comments
I think there is a race condition here, where the client is in the process of closing down and yet the server has sent an event. I will try to reproduce this. |
I'm seeing a similar issue ("Cannot write to closing transport" exception when explicitly calling disconnect on an async client) using python-socket 4.6.0/python-engineio 3.13.2 with the latest aiohttp (3.7.3). I do not observe this with an earlier aiohttp (3.6.2). Looking at the aiohttp release notes (https://docs.aiohttp.org/en/stable/changes.html#id32), it looks to be related to this change: aio-libs/aiohttp#4080. Should the disconnect function be changed to either handle this exception, or somehow cancel the underlying aiohttp web handler task to restore the previous behaviour? Any pointers on the best way to work around this would be appreciated.Thanks! |
I solved this by upgrading to the latest 4.x version of python-socketio and the latest 3.x version of python-engineio (4.6.1 and 3.14.2 respectively), so please disregard. |
@numbereself with the 4.6.1 release of python-socketio I do not get the error, but I do see the missing disconnect handler. Unfortunately the server that you are using has not been upgraded to the latest version of Socket.IO protocol, so I cannot test with the most current version of this package. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
When i try calling the async disconnect function as a result of a packet i get an error stating "Cannot write to closing transport"
Here is the code I used:
And here is the ouput:
I am not exactly sure what this server in particular is running, but I am asuming it is NodeJS.
Also I feel like a disconnect event should fire regardless of the reason. No event fires however.
I was expecting to see the disconnect event fire at least. Also not seeing an exception is preferable.
Or is there an issue about using sleep here?
The text was updated successfully, but these errors were encountered: