Commit 9f64ce5e by Oleksandr Barabash

keyboard interrupt handler added

parent 21277593
...@@ -208,12 +208,15 @@ def main(_argv) -> int: ...@@ -208,12 +208,15 @@ def main(_argv) -> int:
io_loop)) io_loop))
thread = Thread(target=io_loop.run_forever) thread = Thread(target=io_loop.run_forever)
thread.start() thread.start()
try:
while True: while True:
command = input().strip().lower()[:1] command = input().strip().lower()[:1]
if command == "q": if command == "q":
stop_server(ws_client, packet_logger, io_loop)(None, None) stop_server(ws_client, packet_logger, io_loop)(None, None)
thread.join() thread.join()
break break
except KeyboardInterrupt:
stop_server(ws_client, packet_logger, io_loop)(None, None)
return 0 return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment