Skip to content

Commit

Permalink
Await send_sr (#191)
Browse files Browse the repository at this point in the history
* Await send_sr

* Await ping
  • Loading branch information
masell authored and asvetlov committed Mar 5, 2018
1 parent b89a164 commit d1728f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sockjs/transports/rawwebsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ async def server(self, ws, session):

if frame == FRAME_MESSAGE:
for text in data:
ws.send_str(text)
await ws.send_str(text)
elif frame == FRAME_MESSAGE_BLOB:
data = data[1:]
if data.startswith('['):
data = data[1:-1]
ws.send_str(data)
await ws.send_str(data)
elif frame == FRAME_HEARTBEAT:
ws.ping()
await ws.ping()
elif frame == FRAME_CLOSE:
try:
await ws.close(message='Go away!')
Expand Down

0 comments on commit d1728f0

Please sign in to comment.