diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml
index 21f43ce..a319388 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: 7.0.203
+ dotnet-version: 8.0.100
- name: dotnet info
run: dotnet --info
- name: dotnet JT808.Gateway restore
diff --git a/README.md b/README.md
index 62e5271..cd7d933 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,9 @@
# JT808Gateway
-JT808Pipeline支持TCP/UDP通用消息业务处理
-
-[了解JT808协议进这边](https://github.com/SmallChi/JT808)
-
-[了解JT809协议进这边](https://github.com/SmallChi/JT809)
-
-[了解JT1078协议进这边](https://github.com/SmallChi/JT1078)
-
-[了解JTNE协议进这边](https://github.com/SmallChi/JTNewEnergy)
-
- [玩一玩压力测试](https://github.com/SmallChi/JT808Gateway/blob/master/doc/README.md)
+支持TCP/UDP通用消息业务处理
[![MIT Licence](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/SmallChi/JT808Gateway/blob/master/LICENSE)![.NET Core](https://github.com/SmallChi/JT808Gateway/workflows/.NET%20Core/badge.svg?branch=master)
-## 新网关的优势
-
-1. 跨平台
-2. 借助 .NET Core模块化的思想
-3. 单机同时一万辆车在线不是梦(真有一万辆车那都很吃香了<( ̄3 ̄)> <( ̄3 ̄)> <( ̄3 ̄)> )
-4. 简单易上手
-
-## 设计模型
-
-![design_model](https://github.com/SmallChi/JT808Gateway/blob/master/doc/img/design_model.png)
-
## 集成接口功能
| 接口名称 | 接口说明 | 使用场景 |
@@ -102,4 +81,4 @@ Pipeline分为两种方式使用,一种是使用队列的方式,一种是网
- 多协议兼容实现思路[点我查看](https://github.com/SmallChi/JT808Gateway/issues/11#issuecomment-727687417)
-> 单端口兼容多协议虽然可以实现,但是还是不建议这么做,建议最好是用端口分开,避免不必要的麻烦
\ No newline at end of file
+> 单端口兼容多协议虽然可以实现,但是还是不建议这么做,建议最好是用端口分开,避免不必要的麻烦
diff --git a/global.json b/global.json
index 112677b..f3365c4 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "7.0.306"
+ "version": "8.0.100"
}
}
\ No newline at end of file
diff --git a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj
index 097300f..eca2412 100644
--- a/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj
+++ b/simples/JT808.Gateway.SimpleClient/JT808.Gateway.SimpleClient.csproj
@@ -2,14 +2,14 @@
Exe
- net7.0
+ net8.0
-
-
-
-
+
+
+
+
diff --git a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj
index 7ef06ad..e316b72 100644
--- a/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj
+++ b/simples/JT808.Gateway.SimpleQueueNotification/JT808.Gateway.SimpleQueueNotification.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net8.0
diff --git a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj
index b0758b4..001bb60 100644
--- a/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj
+++ b/simples/JT808.Gateway.SimpleQueueServer/JT808.Gateway.SimpleQueueServer.csproj
@@ -2,14 +2,14 @@
Exe
- net7.0
+ net8.0
-
-
-
-
+
+
+
+
diff --git a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj
index fc0b988..eade519 100644
--- a/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj
+++ b/simples/JT808.Gateway.SimpleQueueService/JT808.Gateway.SimpleQueueService.csproj
@@ -2,14 +2,14 @@
Exe
- net7.0
+ net8.0
-
-
-
-
+
+
+
+
diff --git a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj
index dea479b..0b7a760 100644
--- a/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj
+++ b/simples/JT808.Gateway.SimpleServer/JT808.Gateway.SimpleServer.csproj
@@ -2,13 +2,13 @@
Exe
- net7.0
+ net8.0
-
-
-
-
+
+
+
+
diff --git a/simples/JT808.PipelineSimples.sln b/simples/JT808.PipelineSimples.sln
index 9cc8ddf..6962c39 100644
--- a/simples/JT808.PipelineSimples.sln
+++ b/simples/JT808.PipelineSimples.sln
@@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Gateway.SimpleQueueSe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Gateway.SimpleQueueNotification", "JT808.Gateway.SimpleQueueNotification\JT808.Gateway.SimpleQueueNotification.csproj", "{163D2EE2-9A62-4E8A-B203-BF147909E89A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Gateway.NBIotSimpleClient", "JT808.Gateway.NBIotSimpleClient\JT808.Gateway.NBIotSimpleClient.csproj", "{95F159E4-07A3-4736-9D05-2D88EE43FD5E}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -43,10 +41,6 @@ Global
{163D2EE2-9A62-4E8A-B203-BF147909E89A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{163D2EE2-9A62-4E8A-B203-BF147909E89A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{163D2EE2-9A62-4E8A-B203-BF147909E89A}.Release|Any CPU.Build.0 = Release|Any CPU
- {95F159E4-07A3-4736-9D05-2D88EE43FD5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {95F159E4-07A3-4736-9D05-2D88EE43FD5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {95F159E4-07A3-4736-9D05-2D88EE43FD5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {95F159E4-07A3-4736-9D05-2D88EE43FD5E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -57,7 +51,6 @@ Global
{8594AC7F-18B4-439D-B58B-1CEFF0833A1A} = {2459FB59-8A33-49A4-ADBC-A0B12C5886A6}
{E2D1CFEF-417A-4C44-BC2E-E5A160602485} = {2459FB59-8A33-49A4-ADBC-A0B12C5886A6}
{163D2EE2-9A62-4E8A-B203-BF147909E89A} = {2459FB59-8A33-49A4-ADBC-A0B12C5886A6}
- {95F159E4-07A3-4736-9D05-2D88EE43FD5E} = {2459FB59-8A33-49A4-ADBC-A0B12C5886A6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FC0FFCEA-E1EF-4C97-A1C5-F89418B6834B}
diff --git a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj
index d01e6f9..68da2ff 100644
--- a/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj
+++ b/src/JT808.Gateway.Abstractions/JT808.Gateway.Abstractions.csproj
@@ -16,14 +16,17 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
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 57a8e45..37751bf 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
- net7
- 11.0
+ net8.0
+ 12.0
@@ -16,11 +16,11 @@
-
-
-
-
-
+
+
+
+
+
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 e0e5966..e9babaf 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
@@ -2,14 +2,14 @@
Exe
- net7
+ net8.0
-
-
-
-
+
+
+
+
diff --git a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj
index b77e32c..0d53715 100644
--- a/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj
+++ b/src/JT808.Gateway.Client/JT808.Gateway.Client.csproj
@@ -10,14 +10,17 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj
index 9f9695c..899af5e 100644
--- a/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj
+++ b/src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj
@@ -8,7 +8,7 @@
JT808.Gateway.Kafka.xml
-
+
@@ -20,4 +20,8 @@
+
+
+
+
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 20c43f9..fca651f 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
- net7
+ net8.0
@@ -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 b4854cc..bddf72d 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
- net7
+ net8.0
@@ -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 a514bf7..f618c29 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,17 +1,17 @@
- net7.0
+ net8.0
false
-
-
-
-
-
-
+
+
+
+
+
+
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 a6c2efc..312dc89 100644
--- a/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj
+++ b/src/JT808.Gateway.WebApiClientTool/JT808.Gateway.WebApiClientTool.csproj
@@ -13,9 +13,12 @@
-
+
+
+
+
diff --git a/src/JT808.Gateway/JT808.Gateway.csproj b/src/JT808.Gateway/JT808.Gateway.csproj
index 847801c..238debf 100644
--- a/src/JT808.Gateway/JT808.Gateway.csproj
+++ b/src/JT808.Gateway/JT808.Gateway.csproj
@@ -16,7 +16,7 @@
-
+
@@ -26,4 +26,7 @@
+
+
+
diff --git a/src/JT808.Gateway/JT808TcpServer.cs b/src/JT808.Gateway/JT808TcpServer.cs
index 742bd99..c2dd454 100644
--- a/src/JT808.Gateway/JT808TcpServer.cs
+++ b/src/JT808.Gateway/JT808TcpServer.cs
@@ -118,16 +118,9 @@ await Task.Factory.StartNew(async (state) =>
SessionManager.RemoveBySessionId(session.SessionID);
}, jT808TcpSession);
}
- catch (OperationCanceledException)
- {
- break;
- }
- catch (ObjectDisposedException)
- {
- break;
- }
catch (Exception)
{
+ break;
}
}
});
@@ -163,13 +156,11 @@ private async Task FillPipeAsync(JT808TcpSession session, PipeWriter writer)
Logger.LogError($"[{ex.SocketErrorCode},{ex.Message}]:{session.Client.RemoteEndPoint},{session.TerminalPhoneNo}");
break;
}
-#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception ex)
{
Logger.LogError(ex, $"[Receive Error]:{session.Client.RemoteEndPoint},{session.TerminalPhoneNo}");
break;
}
-#pragma warning restore CA1031 // Do not catch general exception types
}
writer.Complete();
}
@@ -177,7 +168,7 @@ private async Task ReadPipeAsync(JT808TcpSession session, PipeReader reader)
{
while (true)
{
- ReadResult result = await reader.ReadAsync();
+ ReadResult result = await reader.ReadAsync(session.ReceiveTimeout.Token);
if (result.IsCompleted)
{
break;
@@ -314,14 +305,13 @@ private void Processor(in IJT808Session session, in JT808HeaderPackage package)
public Task StopAsync(CancellationToken cancellationToken)
{
Logger.LogInformation("JT808 Tcp Server Stop");
- if (server?.Connected ?? false)
- server.Shutdown(SocketShutdown.Both);
- server?.Close();
- server?.Dispose();
foreach (var item in SessionManager.Sessions)
{
item.Value.Client.Close();
}
+ if (server?.Connected ?? false)
+ server.Shutdown(SocketShutdown.Both);
+ server?.Close();
return Task.CompletedTask;
}
}
diff --git a/src/JT808.Gateway/JT808UdpServer.cs b/src/JT808.Gateway/JT808UdpServer.cs
index 7338c36..a95c50e 100644
--- a/src/JT808.Gateway/JT808UdpServer.cs
+++ b/src/JT808.Gateway/JT808UdpServer.cs
@@ -100,7 +100,7 @@ private void ReaderBuffer(ReadOnlySpan buffer, Socket socket,SocketReceive
{
try
{
- var package = Serializer.HeaderDeserialize(buffer, minBufferSize: 4096);
+ var package = Serializer.HeaderDeserialize(buffer, minBufferSize: ConfigurationMonitor.CurrentValue.MiniNumBufferSize);
if (Logger.IsEnabled(LogLevel.Trace)) Logger.LogTrace($"[Accept Hex {receiveMessageFromResult.RemoteEndPoint}]:{package.OriginalData.ToHexString()}");
var session = SessionManager.TryLink(package.Header.TerminalPhoneNo, socket, receiveMessageFromResult.RemoteEndPoint);
if (Logger.IsEnabled(LogLevel.Information))
@@ -117,12 +117,10 @@ private void ReaderBuffer(ReadOnlySpan buffer, Socket socket,SocketReceive
{
Logger.LogError($"[HeaderDeserialize ErrorCode]:{ ex.ErrorCode},[ReaderBuffer]:{buffer.ToArray().ToHexString()}");
}
-#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception ex)
{
Logger.LogError(ex, $"[ReaderBuffer]:{ buffer.ToArray().ToHexString()}");
}
-#pragma warning restore CA1031 // Do not catch general exception types
}
private void Processor(in IJT808Session session, in JT808HeaderPackage package)
diff --git a/src/PipelineInfo.props b/src/PipelineInfo.props
index b6563bb..d09b504 100644
--- a/src/PipelineInfo.props
+++ b/src/PipelineInfo.props
@@ -1,14 +1,14 @@
- net7.0
- 11.0
+ net8.0
+ 12.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-preview6
+ 1.1.8-preview7
LICENSE
true
latest