main.py 392 B

12345678910111213141516
  1. import asyncio
  2. from ws_client import start_ws_clients
  3. from ws_server import start_websocket_server
  4. import warnings
  5. # 忽略 FutureWarning
  6. warnings.simplefilter(action='ignore', category=FutureWarning)
  7. # 启动 WebSocket 客户端
  8. start_ws_clients()
  9. # 启动 WebSocket 服务器
  10. asyncio.run(start_websocket_server())
  11. # 停止所有线程(在需要停止时调用)
  12. # stop_all_threads()