From 740729c8473fa0bf7024d75a9e236f487ab6fd40 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 20 Sep 2026 10:11:12 +0800 Subject: [PATCH] Raise speed test concurrency minimum --- v2rayN/ServiceLib/Global.cs | 3 ++- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 5 +---- v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs | 2 +- v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 009985d7..7f645ddc 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -92,13 +92,14 @@ public class Global public const string XrayLocalAsset = "XRAY_LOCATION_ASSET"; public const string XrayLocalCert = "XRAY_LOCATION_CERT"; public const int SpeedTestPageSize = 1000; + public const int SpeedTestConcurrencyCountMin = 10; public const string LinuxBash = "/bin/bash"; public const string StringTrue = "true"; public const string StringFalse = "false"; public const int SqliteMaxBatchSize = 10000; public static readonly TimeSpan LocalFetch = TimeSpan.FromSeconds(5); public static readonly TimeSpan DirectFetch = TimeSpan.FromSeconds(10); - public static readonly TimeSpan ProxyFetch = TimeSpan.FromSeconds(30); + public static readonly TimeSpan ProxyFetch = TimeSpan.FromSeconds(30); public static readonly TimeSpan DirectDownloadConnect = TimeSpan.FromSeconds(5); public static readonly TimeSpan ProxyDownloadConnect = TimeSpan.FromSeconds(10); diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index b9b27dbb..68c7f490 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -136,10 +136,7 @@ public static class ConfigHandler { config.SpeedTestItem.SpeedPingTestUrl = Global.SpeedPingTestUrls.First(); } - if (config.SpeedTestItem.MixedConcurrencyCount < 1) - { - config.SpeedTestItem.MixedConcurrencyCount = 5; - } + config.SpeedTestItem.MixedConcurrencyCount = Math.Max(config.SpeedTestItem.MixedConcurrencyCount, Global.SpeedTestConcurrencyCountMin); if (config.SpeedTestItem.UdpTestTarget.IsNullOrEmpty()) { config.SpeedTestItem.UdpTestTarget = Global.UdpTestTargets.First(); diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs index 8f8e609d..b2f02a21 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs @@ -47,7 +47,7 @@ public partial class OptionSettingWindow : WindowBase cmbCoreType7.ItemsSource = Global.CoreTypes; cmbCoreType9.ItemsSource = Global.CoreTypes; - cmbMixedConcurrencyCount.ItemsSource = Enumerable.Range(2, 7).ToList(); + cmbMixedConcurrencyCount.ItemsSource = Enumerable.Range(Global.SpeedTestConcurrencyCountMin, 20).ToList(); cmbSpeedTestTimeout.ItemsSource = Enumerable.Range(2, 5).Select(i => i * 5).ToList(); cmbSpeedTestUrl.ItemsSource = Global.SpeedTestUrls; cmbSpeedPingTestUrl.ItemsSource = Global.SpeedPingTestUrls; diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index b974ef14..e1dbecd5 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -43,7 +43,7 @@ public partial class OptionSettingWindow cmbCoreType7.ItemsSource = Global.CoreTypes; cmbCoreType9.ItemsSource = Global.CoreTypes; - cmbMixedConcurrencyCount.ItemsSource = Enumerable.Range(2, 7).ToList(); + cmbMixedConcurrencyCount.ItemsSource = Enumerable.Range(Global.SpeedTestConcurrencyCountMin, 20).ToList(); cmbSpeedTestTimeout.ItemsSource = Enumerable.Range(2, 5).Select(i => i * 5).ToList(); cmbSpeedTestUrl.ItemsSource = Global.SpeedTestUrls; cmbSpeedPingTestUrl.ItemsSource = Global.SpeedPingTestUrls;