This commit is contained in:
xyj 2024-01-05 09:03:41 +08:00
parent 4d757b9f41
commit 9d1baaec22
1 changed files with 1 additions and 3 deletions

4
skt.py
View File

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