no close frame received or sent
Hello, thanks for all the work that you've done.
I'm using your script on Linux and after some time of receiving order book, I get the exception "no close frame received or sent".
Not sure why this happens and I'm not able to stop the execution to re-run the script to start over.
- I tested it on a VPS too
- Used
trycatchto print the error (which works) and leave the loop (which doesn't work) - Freezes after printing the error "no close frame received or sent"
try:
loop = asyncio.new_event_loop()
loop.run_until_complete(ASYNC_FUNCTION_NAME)
except KeyboardInterrupt:
print("KeyboardInterrupt")
except Exception as error:
print(f"CLI Exception {error=}")
finally:
loop.close()
With regards
Hello, this error is caused by an abrupt connection close. The conection was closed by the remote but no "connection close" frame was received.
I can try to add a reconnection functionality but of course the program should at least exit with error and not keep running but doing nothing.
I will add a functionality to raise to the top level program this error (and if not handled, the aplication will end with error). Is this ok for you?
Thank you so much @maxpowel
I will add a functionality to raise to the top level program this error (and if not handled, the aplication will end with error). Is this ok for you?
This would be amazing. I should also mention that the above code works and catches the exception but I would appreciate it if you could make necessary changes to raise the exception so that people simply can catch it. (I am not sure why I wasn't able to catch it in other types of Asyncio loops and run.
Thanks in advance