bugfix
This commit is contained in:
parent
603d6bfe82
commit
6b1aece29e
@ -1,2 +1,15 @@
|
||||
print('ws_data=', ws_data)
|
||||
return 'resp:' + ws_data
|
||||
# ws_data 客户端传过来的数据
|
||||
# ws_pool 保存所有链接
|
||||
# register(id)
|
||||
# 注册自己,id必须唯一
|
||||
# sendto(data, id=None)
|
||||
# 发送消息给客户端,当id为空时,发送给当前链接的客户端,否则发送给id指定的客户端
|
||||
# is_online(id)
|
||||
# 检查id指定的客户端是否在线
|
||||
resp = 'resp=' + ws_data
|
||||
user = await get_user()
|
||||
ws_pool.register(user)
|
||||
print(f'{resp=}, {user=}')
|
||||
await ws_pool.sendto(resp)
|
||||
if ws_pool.is_online('bington'):
|
||||
await ws_pool.sendto(resp, 'bington')
|
||||
|
Loading…
Reference in New Issue
Block a user