Skip to content

Commit

Permalink
Fix server websocket example
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 8, 2015
1 parent 55b7cb0 commit 50fa781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ using response's methods:
ws = web.WebSocketResponse()
await ws.prepare(request)
while True:
while not ws.closed:
msg = await ws.receive()
if msg.tp == aiohttp.MsgType.text:
Expand All @@ -407,7 +407,7 @@ using response's methods:
elif msg.tp == aiohttp.MsgType.close:
print('websocket connection closed')
elif msg.tp == aiohttp.MsgType.error:
print('ws connection closed with exception %s',
print('ws connection closed with exception %s' %
ws.exception())
return ws
Expand Down

0 comments on commit 50fa781

Please sign in to comment.