Hello ,
I have a wroking websocket server that my application connected to him and send data to the server.
my problem is that sometime the APP send 5-6 messages , while my code didn't finish the first request yet.
so I can see it "running over" and make a lot of mess :-)
is there any way to tell him to wait until finish , then read the next one?
I don't mind him to ignore the messges until he finsih
this is what I have
I have a wroking websocket server that my application connected to him and send data to the server.
my problem is that sometime the APP send 5-6 messages , while my code didn't finish the first request yet.
so I can see it "running over" and make a lot of mess :-)
is there any way to tell him to wait until finish , then read the next one?
I don't mind him to ignore the messges until he finsih
this is what I have
async def hello(websocket, path): global OldClientRespone print("--------------------------->" + OldClientRespone) ClientResponse = await websocket.recv() print ("OLD is - " + OldClientRespone+ "\r\nNew is " + ClientResponse) ## some code that take about 5 seconds to be finish start_server = websockets.serve(hello, '10.0.0.100', 1234) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever()Thanks,