diff --git a/src/JT808.DotNetty.CleintBenchmark/Configs/ClientBenchmarkOptions.cs b/src/JT808.DotNetty.CleintBenchmark/Configs/ClientBenchmarkOptions.cs index 564da09..d1842d1 100644 --- a/src/JT808.DotNetty.CleintBenchmark/Configs/ClientBenchmarkOptions.cs +++ b/src/JT808.DotNetty.CleintBenchmark/Configs/ClientBenchmarkOptions.cs @@ -14,6 +14,11 @@ namespace JT808.DotNetty.CleintBenchmark.Configs /// 5000ms毫秒 /// public int Interval { get; set; } = 5000; + /// + /// 需要多台机器同时访问,那么可以根据这个避开重复终端号 + /// 100000-200000-300000 + /// + public int DeviceTemplate { get; set; } = 0; public ClientBenchmarkOptions Value =>this; } } diff --git a/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj b/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj index 8983666..cc4b46b 100644 --- a/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj +++ b/src/JT808.DotNetty.CleintBenchmark/JT808.DotNetty.CleintBenchmark.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.0 + netcoreapp3.1 7.3 diff --git a/src/JT808.DotNetty.CleintBenchmark/Services/CleintBenchmarkHostedService.cs b/src/JT808.DotNetty.CleintBenchmark/Services/CleintBenchmarkHostedService.cs index a4811df..b6d61ab 100644 --- a/src/JT808.DotNetty.CleintBenchmark/Services/CleintBenchmarkHostedService.cs +++ b/src/JT808.DotNetty.CleintBenchmark/Services/CleintBenchmarkHostedService.cs @@ -51,7 +51,7 @@ namespace JT808.DotNetty.CleintBenchmark.Services { taskFactory.StartNew((item) => { - var client = jT808TcpClientFactory.Create(new JT808DeviceConfig(((int)item+1).ToString(), clientBenchmarkOptions.IP, clientBenchmarkOptions.Port)); + var client = jT808TcpClientFactory.Create(new JT808DeviceConfig(((int)item+1+ clientBenchmarkOptions.DeviceTemplate).ToString(), clientBenchmarkOptions.IP, clientBenchmarkOptions.Port)); int lat = new Random(1000).Next(100000, 180000); int Lng = new Random(1000).Next(100000, 180000); while (!cts.IsCancellationRequested) diff --git a/src/JT808.DotNetty.CleintBenchmark/appsettings.json b/src/JT808.DotNetty.CleintBenchmark/appsettings.json index fe9b3c0..eb6044b 100644 --- a/src/JT808.DotNetty.CleintBenchmark/appsettings.json +++ b/src/JT808.DotNetty.CleintBenchmark/appsettings.json @@ -15,6 +15,7 @@ "ClientBenchmarkOptions": { "IP": "", "Port": 808, - "DeviceCount": 1 + "DeviceCount": 100, + "DeviceTemplate": 300000 //需要多台机器同时访问,那么可以根据这个避开重复终端号 100000-200000-300000 } }