def echo(ws):
cs.add(ws)
print(u'???'+str(ws)+u'???websocket')
for _msg in cache['msg']:
ws.send(_msg)
while True:
msg = ws.receive()
if msg is not None:
_dict = json.loads(msg)
_type = _dict.get("action",EVENT_EMPTY)
if _type in funcs:
funcs[_type]((msg,_dict))
else:
empty_func(msg)
else: break
cs.remove(ws)
print(u'???'+str(ws)+u'????')
评论列表
文章目录