| 12345678910111213141516 |
- import asyncio
- from ws_client import start_ws_clients
- from ws_server import start_websocket_server
- import warnings
- # 忽略 FutureWarning
- warnings.simplefilter(action='ignore', category=FutureWarning)
- # 启动 WebSocket 客户端
- start_ws_clients()
- # 启动 WebSocket 服务器
- asyncio.run(start_websocket_server())
- # 停止所有线程(在需要停止时调用)
- # stop_all_threads()
|