update
This commit is contained in:
parent
4d757b9f41
commit
9d1baaec22
4
skt.py
4
skt.py
|
@ -122,7 +122,6 @@ user_msg = {}
|
||||||
|
|
||||||
# 创建WebSocket连接的处理函数
|
# 创建WebSocket连接的处理函数
|
||||||
async def handler(websocket, path):
|
async def handler(websocket, path):
|
||||||
msg = ""
|
|
||||||
try:
|
try:
|
||||||
# 在循环中等待客户端的消息
|
# 在循环中等待客户端的消息
|
||||||
async for message in websocket:
|
async for message in websocket:
|
||||||
|
@ -131,10 +130,9 @@ async def handler(websocket, path):
|
||||||
response = await function_A(websocket, message)
|
response = await function_A(websocket, message)
|
||||||
await websocket.send(response)
|
await websocket.send(response)
|
||||||
# 本地情况
|
# 本地情况
|
||||||
# await function_B(websocket, message)
|
await function_B(websocket, message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = user_msg[websocket]
|
msg = user_msg[websocket]
|
||||||
print("Exception=", msg)
|
|
||||||
await function_B(websocket, msg)
|
await function_B(websocket, msg)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue