private void CloseIdleConnections(Pool <Connection> pool, int count) { while (count > 0) { Connection conn; if (!pool.TryDequeueLast(out conn)) { break; } if (cluster.IsConnCurrentTrim(conn.LastUsed)) { if (!pool.EnqueueLast(conn)) { CloseConnection(conn); } break; } CloseConnection(conn); count--; } }