From b532549f3c4457c06b005a7bce604cd7f632ca90 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Sat, 26 Nov 2022 11:46:24 +0800 Subject: [PATCH] pipeline-1.1.8-preview3 add net7.0 --- .github/workflows/dotnetcore.yml | 2 +- .../JT808.Gateway.NBIotSimpleClient.csproj | 12 ++++++------ .../JT808.Gateway.SimpleClient.csproj | 10 +++++----- .../JT808.Gateway.SimpleQueueNotification.csproj | 2 +- .../JT808.Gateway.SimpleQueueServer.csproj | 10 +++++----- .../JT808.Gateway.SimpleQueueService.csproj | 10 +++++----- .../JT808.Gateway.SimpleServer.csproj | 10 +++++----- simples/global.json | 2 +- .../JT808.Gateway.Abstractions.csproj | 10 +++++----- .../JT808.Gateway.CleintBenchmark.csproj | 14 +++++++------- .../Services/CleintBenchmarkHostedService.cs | 11 +++++------ .../JT808.Gateway.CleintBenchmark/appsettings.json | 8 ++++---- .../JT808.Gateway.ServerBenchmark.csproj | 10 +++++----- .../JT808.Gateway.Client.csproj | 10 +++++----- .../JT808.Gateway.NormalHosting.csproj | 10 +++++----- .../JT808.Gateway.QueueHosting.csproj | 8 ++++---- .../JT808.Gateway.Test/JT808.Gateway.Test.csproj | 12 ++++++------ .../JT808.Gateway.WebApiClientTool.csproj | 2 +- src/JT808.Gateway/JT808.Gateway.csproj | 2 +- src/JT808.Gateway/JT808TcpServer.cs | 4 ++-- src/PipelineInfo.props | 6 +++--- src/global.json | 2 +- 22 files changed, 83 insertions(+), 84 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 5240dd8..8554994 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: 6.0.400 + dotnet-version: 7.0.100 - name: dotnet info run: dotnet --info - name: dotnet JT808.Gateway restore diff --git a/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj b/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj index ceef993..3df6273 100644 --- a/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj +++ b/simples/JT808.Gateway.NBIotSimpleClient/JT808.Gateway.NBIotSimpleClient.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 - - - - - + + + + + diff --git a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj index 066aa4e..3b3300e 100644 --- a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj +++ b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 - - - - + + + + diff --git a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj index e642c8c..7ef06ad 100644 --- a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj +++ b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 diff --git a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj index 6fcb95e..9dea51c 100644 --- a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj +++ b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 - - - - + + + + diff --git a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj index 32cf74e..2d853d0 100644 --- a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj +++ b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 - - - - + + + + diff --git a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj index b0988eb..3becff5 100644 --- a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj +++ b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj @@ -2,13 +2,13 @@ Exe - net6.0 + net7.0 - - - - + + + + diff --git a/simples/global.json b/simples/global.json index d769cd3..08585a2 100644 --- a/simples/global.json +++ b/simples/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.400" + "version": "7.0.100" } } \ No newline at end of file diff --git a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj index 57eb4f6..b69a484 100644 --- a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj +++ b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj index 6934ab3..df491b1 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/JT808.Gateway.CleintBenchmark.csproj @@ -2,8 +2,8 @@ Exe - net6 - 10.0 + net7 + 11.0 @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/Services/CleintBenchmarkHostedService.cs b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/Services/CleintBenchmarkHostedService.cs index fc59fef..aa2f6fb 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/Services/CleintBenchmarkHostedService.cs +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/Services/CleintBenchmarkHostedService.cs @@ -44,8 +44,8 @@ namespace JT808.Gateway.CleintBenchmark.Services ThreadPool.GetMaxThreads(out var maxWorkerThreads, out var maxCompletionPortThreads); logger.LogInformation($"GetMinThreads:{minWorkerThreads}-{minCompletionPortThreads}"); logger.LogInformation($"GetMaxThreads:{maxWorkerThreads}-{maxCompletionPortThreads}"); - taskFactory = new TaskFactory(cancellationToken); - new Thread(() => { + taskFactory = new TaskFactory(cancellationToken, TaskCreationOptions.PreferFairness, TaskContinuationOptions.PreferFairness, TaskScheduler.Default); + Task.Run(() => { for (int i = 0; i < clientBenchmarkOptions.DeviceCount; i++) { taskFactory.StartNew(async (state) => { @@ -80,12 +80,11 @@ namespace JT808.Gateway.CleintBenchmark.Services { logger.LogError(ex.Message); } - Thread.Sleep(clientBenchmarkOptions.Interval); + await Task.Delay(TimeSpan.FromMilliseconds(clientBenchmarkOptions.Interval)); } - }, i); - Thread.Sleep(300); + }, i,cancellationToken, TaskCreationOptions.PreferFairness, TaskScheduler.Default); } - }).Start(); + }); return Task.CompletedTask; } diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/appsettings.json b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/appsettings.json index 9fe3b2f..f1ea7a7 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/appsettings.json +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.CleintBenchmark/appsettings.json @@ -15,10 +15,10 @@ "AllowedHosts": "*", "urls": "http://*:5000;", "ClientBenchmarkOptions": { - "IP": "127.0.0.1", + "IP": "120.77.144.129", "Port": 808, - "DeviceCount": 100, - "Interval": 1000, - "DeviceTemplate": 100000 //需要多台机器同时访问,那么可以根据这个避开重复终端号 100000-200000-300000 + "DeviceCount": 10000, + "Interval": 5000, + "DeviceTemplate": 6100000 //需要多台机器同时访问,那么可以根据这个避开重复终端号 100000-200000-300000 } } diff --git a/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj b/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj index 523a07e..be7b47a 100644 --- a/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj +++ b/src/JT808.Gateway.Benchmark/JT808.Gateway.ServerBenchmark/JT808.Gateway.ServerBenchmark.csproj @@ -1,15 +1,15 @@ - + Exe - net6 + net7 - - + + - + diff --git a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj index b1279a3..bc82b84 100644 --- a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj +++ b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj @@ -10,11 +10,11 @@ - - - - - + + + + + diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj index 8a49f41..04f9a26 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.NormalHosting/JT808.Gateway.NormalHosting.csproj @@ -2,7 +2,7 @@ Exe - net6 + net7 @@ -22,11 +22,11 @@ - - - + + + - + diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj index 00befa3..16918a6 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.QueueHosting/JT808.Gateway.QueueHosting.csproj @@ -2,7 +2,7 @@ Exe - net6 + net7 @@ -10,10 +10,10 @@ - - + + - + diff --git a/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj b/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj index 1f19d2e..40e3605 100644 --- a/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj +++ b/src/JT808.Gateway.Tests/JT808.Gateway.Test/JT808.Gateway.Test.csproj @@ -1,21 +1,21 @@  - net6.0 + net7.0 false - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj b/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj index d2de7ce..a6c2efc 100644 --- a/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj +++ b/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/JT808.Gateway/JT808.Gateway.csproj b/src/JT808.Gateway/JT808.Gateway.csproj index dda24c6..a323d1d 100644 --- a/src/JT808.Gateway/JT808.Gateway.csproj +++ b/src/JT808.Gateway/JT808.Gateway.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/JT808.Gateway/JT808TcpServer.cs b/src/JT808.Gateway/JT808TcpServer.cs index e43c76a..8f6ecda 100644 --- a/src/JT808.Gateway/JT808TcpServer.cs +++ b/src/JT808.Gateway/JT808TcpServer.cs @@ -101,7 +101,7 @@ namespace JT808.Gateway { try { - var socket = await server.AcceptAsync(); + var socket = await server.AcceptAsync(cancellationToken); JT808TcpSession jT808TcpSession = new JT808TcpSession(socket); SessionManager.TryAdd(jT808TcpSession); await Task.Factory.StartNew(async (state) => @@ -116,7 +116,7 @@ namespace JT808.Gateway Task reading = ReadPipeAsync(session, pipe.Reader); await Task.WhenAll(reading, writing); SessionManager.RemoveBySessionId(session.SessionID); - }, jT808TcpSession, cancellationToken, TaskCreationOptions.PreferFairness, TaskScheduler.Default); + }, jT808TcpSession); } catch (OperationCanceledException) { diff --git a/src/PipelineInfo.props b/src/PipelineInfo.props index 2fb7c01..cf58ab9 100644 --- a/src/PipelineInfo.props +++ b/src/PipelineInfo.props @@ -1,14 +1,14 @@  - net6.0 - 10.0 + net7.0 + 11.0 Copyright 2019. SmallChi(Koike) https://github.com/SmallChi/JT808Gateway https://github.com/SmallChi/JT808Gateway https://github.com/SmallChi/JT808Gateway/blob/master/LICENSE https://github.com/SmallChi/JT808Gateway/blob/master/LICENSE - 1.1.8-preview2 + 1.1.8-preview3 LICENSE true latest diff --git a/src/global.json b/src/global.json index d769cd3..08585a2 100644 --- a/src/global.json +++ b/src/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.400" + "version": "7.0.100" } } \ No newline at end of file