fix:修改TCP连接逻辑

1. 修改TCP连接逻辑
2. 新增查询最新数据的接口
This commit is contained in:
fengyarnom 2025-05-15 18:26:50 +08:00
parent 36766ead45
commit a673267fd3

View File

@ -66,8 +66,8 @@ func removeConnection(addr string) {
logger.Logger.Printf("移除连接: %s, 当前连接数: %d", addr, len(activeConnections.conns)) logger.Logger.Printf("移除连接: %s, 当前连接数: %d", addr, len(activeConnections.conns))
} }
// 获取活跃连接数量 // GetActiveConnectionCount 获取活跃连接数量
func getActiveConnectionCount() int { func GetActiveConnectionCount() int {
activeConnections.mu.RLock() activeConnections.mu.RLock()
defer activeConnections.mu.RUnlock() defer activeConnections.mu.RUnlock()