def _runner(self):
#look at wsdump.py later to handle opcodes
while not self.killed:
try:
a = self.ws.recv()
except websocket.WebSocketConnectionClosedException as e:
if self.on_websocket_closed is not None:
self.on_websocket_closed(self.room_id)
elif not self.killed:
raise e
else:
pass
self.killed = True
break
except:
# this is hacky and bad, please don't look too closely :) -Mego
if self.killed:
pass
else:
raise
if a is not None and a != "":
self.on_activity(json.loads(a))
评论列表
文章目录