[patch] 优化心跳检测逻辑 优化与后端交互连接处理逻辑 新增自动登录与手动下发冲突问题解决方法块

This commit is contained in:
2025-10-17 11:29:27 +08:00
parent e2ab13d599
commit 1438e39ffd
3 changed files with 132 additions and 26 deletions

View File

@@ -8,8 +8,9 @@ import os # 用于路径与目录操作(写入用户配置目录)
import json # 用于将令牌保存为 JSON 格式
# 后端服务器配置
BACKEND_HOST = "192.168.5.103"
# BACKEND_HOST = "192.168.5.233"
BACKEND_HOST = "192.168.5.106"
# BACKEND_HOST = "192.168.5.12"
# BACKEND_HOST = "shuidrop.com"
# BACKEND_HOST = "test.shuidrop.com"
BACKEND_PORT = "8000"
@@ -20,8 +21,8 @@ BACKEND_WS_URL = f"ws://{BACKEND_HOST}:{BACKEND_PORT}"
# WebSocket配置
WS_CONNECT_TIMEOUT = 16.0
WS_MESSAGE_TIMEOUT = 30.0
WS_PING_INTERVAL = 10 # 10秒ping间隔提高检测频率
WS_PING_TIMEOUT = 5 # 5秒ping超时更快检测断线
WS_PING_INTERVAL = 20 # 20秒ping间隔平衡稳定性和响应速度
WS_PING_TIMEOUT = 10 # 10秒ping超时给打包环境更多时间响应
WS_ENABLE_PING = True # 是否启用WebSocket原生ping心跳
WS_ENABLE_APP_PING = False # 禁用应用层ping心跳避免重复