Closed MeRuslan closed 3 years ago
If you feed a server that allows connecting, but does not respond, it would simply hang on forever in server.async_status()
.
This PR fixes that.
PS it breaks one of the existing tests, but I'm not sure why exactly. Cause nothing really changes.
Frankly, I think that test does not works as intended, even without my changes.
I.e. without my changes the exception is raised nonetheless raise IOError("Received invalid ping response packet.")
, ping is successful only the second time it's called, which is a test bug it seems.
I found the cause was related to closing the client connection early in that test that was failing. I've fixed that and python 3.6 compatibilities, so I'm about to release v6.3.0 which includes this.
TCPAsyncSocketConnection uses
asyncio.wait_for
wrapper only when connecting. Now it uses it for reading as well, as per usual, test included.