-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
websocket client: when the network is bad, it shows fatal read error message #3202
Comments
Definitely, not a bug of aiohttp nor Pythonista, but remote server which couldn't respond within specified timeout interval. There is nothing to do from aiohttp side. |
@kxepal "remote server which couldn't respond within specified timeout interval"? I wrap timeout with the receive function like https://github.com/yjqiang/bilibili-live-tools/blob/master/bilibiliCilent.py#L92 . |
I cannot understand how did you get |
The server said we must send a special heartbeat package 1 time per 30 seconds, and it would send a confirm msg to client after receiving the msg. So I wrote that to make sure that when the server closes the connection but without talking to client, after 35s, the client will find that fact. |
Can I handle the error "TimeoutError: [Errno 60] Operation timed out" by myself? I used try and exception, but it did not work at all. |
Sorry my English is not good so I think maybe I misunderstood your words. You mean why the msg is TimeoutError instead of asyncio.TimeoutError? I can't get it too. Maybe it is a bug in pythonista? |
@yjqiang yes. I mean that I know nothing about pythonista thogh |
omz/Pythonista-Issues#563 |
The reason why it raises TimeoutError is that the code in omz/Pythonista-Issues#563 (comment) |
From my understanding, the error should be never raised for a nonblocking socket, only UPD. I need to investigate more. |
"a NAT gateway could time out after some minutes of not doing anything" So the server does not work well or the network is not normal, after I setup the connection. If it is that reason, maybe aiohttp/asyncio should raise this exception when I use recv() and let us handle it? But maybe they would hold the exception for a long time if I did not use recv() immediately. |
The current behavior is:
The logging can be suppressed in next Python release (as we do it for |
Thanks. |
@asvetlov https://bugs.python.org/issue34148 I think it should be fixed by just add |
Move discussion to Python bug tracker |
No response yet for 2 months. |
This is a msg in PYTHONISTA on ios (python 3.6.1). So maybe it is a bug in pythonista.
Fatal read error on socket transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x1177ce940>
transport: <_SelectorSocketTransport fd=47 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/var/containers/Bundle/Application/9F565D30-C54B-4210-902B-874D7A5AB814/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/selector_events.py", line 725, in _read_ready
data = self._sock.recv(self.max_size)
TimeoutError: [Errno 60] Operation timed out
The text was updated successfully, but these errors were encountered: