我有我正在制作的游戏的代码:
async def ws(websocket, path):
connected.append(websocket)
try:
while True:
if(running == 0):
asyncio.ensure_future(main_loop(websocket, path))
recivedData = await websocket.recv()
parsedData = json.loads(recivedData)
print(parsedData)
finally:
connected.remove(websocket)
在此代码中,main_loop负责以恒定速率发送消息。但是,等待websocket.recv()似乎没有收到任何东西。我哪里出错了?