-
-
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
Incomplete Websockets Documentation #1144
Labels
Comments
Agree with implicit catching closing message in |
Great.
Yeah sure, I can do that. |
frederikaalund
added a commit
to frederikaalund/aiohttp
that referenced
this issue
Sep 7, 2016
3 tasks
frederikaalund
added a commit
to frederikaalund/aiohttp
that referenced
this issue
Oct 18, 2016
frederikaalund
added a commit
to frederikaalund/aiohttp
that referenced
this issue
Oct 19, 2016
frederikaalund
added a commit
to frederikaalund/aiohttp
that referenced
this issue
Oct 19, 2016
frederikaalund
pushed a commit
to frederikaalund/aiohttp
that referenced
this issue
Oct 19, 2016
asvetlov
pushed a commit
that referenced
this issue
Oct 21, 2016
* Websockets: Stop iteration when connection closes. See issue #1144. * WebsocketResponse: Async for now stops iteration when WSMsgType.Closed is passed down (and not just WsMsgType.Close). * Tests: Added tests for the async for functionality of the websocket response and websocket client response. * Moved python3.5 'async for closed' tests unto the test_py35 directory equivalents. * Added Frederik Peter Aalund to CONTRIBUTORS.txt * Updated CHANGES.rst to reflect that #1144 is now fixed.
Fixed by #1145 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The current websockets documentation only handles two message types:
MsgType.text
andMsgType.error
. However, a runtime error may occur ifMsgType.closed
is not handled as well. This should be clear from the official documentation.It took me a long time to figure out why my program returned errors because of this. Now that we are at it: Why not simply catch the
MsgType.closed
in the__anext__
function? It is unintuitive thatautoclose=True
(which is also the default) doesn't deal withMsgType.closed
when it deals withMsgType.close
. I realize that the former is your own internal message while the latter is part of the WS standard.Side note: In the web_ws example this is implicitly handled correctly through an else clause.
I'm using Python 3.5.1 and Aiohttp 0.22.5.
The text was updated successfully, but these errors were encountered: