Commit Graph

10 Commits

Author SHA1 Message Date
wenzuhuai
8f67431623 fix: 修复 handleDisconnect 在 disconnect 失败时不触发 .disconnected 事件的问题 2026-01-28 13:38:51 +08:00
wenzuhuai
ec4618db87 fix: 重连成功后重置 outstandingPings 计数器,修复频繁重连问题 2026-01-23 09:58:40 +08:00
wenzuhuai
30fb5d8b27 fix: 将断网场景的错误日志降级为 debug 级别
- Error closing connection 降级为 debug(TLS 关闭错误是断网预期行为)
- Write failed: batchBuffer is nil 降级为 debug
- Write operation failed 降级为 debug
- 避免长时间断网恢复时日志泛滥
2026-01-23 09:34:33 +08:00
wenzuhuai
cd680abe55 fix: 修复 errorCaught 导致的频繁重连问题
- 移除 errorCaught 中重复的 handleDisconnect 调用
- 将 uncleanShutdown 日志降级为 debug 级别
- 避免双重触发导致的断开重连循环
2026-01-23 09:06:50 +08:00
wenzuhuai
b014494819 fix: write操作在batchBuffer为nil时也触发重连
- 解决"假连接"边界情况:状态为connected但batchBuffer为nil
- 确保发送消息失败后能自动恢复连接
2026-01-22 09:52:52 +08:00
wenzuhuai
387f6cf273 fix: 修复闭包参数混用导致的编译错误 2026-01-22 09:18:44 +08:00
wenzuhuai
e452971586 fix: 修复channelInactive状态检查不完整导致的重连问题
- 将 channelInactive 的状态检查从仅处理 connected 状态改为处理所有非 closed/disconnected 状态
- 与 errorCaught 的处理逻辑保持一致
- 确保在 connecting/pending 状态下网络断开时也能正确触发重连
2026-01-22 09:08:01 +08:00
wenzuhuai
5ad1174292 fix: improve connection stability and add connection check API
Some checks failed
ci / macos (push) Has been cancelled
ci / ios (push) Has been cancelled
ci / check-linter (push) Has been cancelled
- Fix race condition in resource cleanup during disconnect/cancel
- Trigger reconnect on ping send failure
- Trigger reconnect on write operation failure
- Add isConnected and connectionState properties
- Add checkConnection() method for active connection testing
- Add ensureConnected() method for proactive connection recovery
2026-01-21 11:43:23 +08:00
wenzuhuai
153e600bbc fix: clear pending pings to avoid promise leaks on connection close/suspend
Some checks failed
ci / macos (push) Has been cancelled
ci / ios (push) Has been cancelled
ci / check-linter (push) Has been cancelled
- Add cancel() method to RttCommand to fail promise on connection close
- Add dequeueAll() method to ConcurrentQueue for batch cleanup
- Call clearPendingPings() in close(), suspend(), and disconnect() methods
- Prevents 'leaking promise' crash when connection is closed while pings are pending
2026-01-12 19:16:56 +08:00
wenzuhuai
d7bdb4f378 init
Some checks failed
ci / macos (push) Has been cancelled
ci / ios (push) Has been cancelled
ci / check-linter (push) Has been cancelled
2026-01-12 18:29:52 +08:00