@@ -47,7 +47,7 @@ | |||
### <span id="tcp_send">基于Tcp统一下发设备消息服务</span> | |||
请求地址:UnificationTcpSend | |||
请求地址:Tcp/UnificationSend | |||
请求方式:POST | |||
@@ -76,7 +76,7 @@ | |||
### <span id="udp_send">基于Udp统一下发设备消息服务</span> | |||
请求地址:UnificationUdpSend | |||
请求地址:Udp/UnificationSend | |||
请求方式:POST | |||
@@ -116,7 +116,7 @@ | |||
#### 1.获取会话集合 | |||
请求地址:Session/Tcp/GetAll | |||
请求地址:Tcp/Session/GetAll | |||
请求方式:GET | |||
@@ -150,7 +150,7 @@ | |||
#### 2.通过设备终端号移除对应会话 | |||
请求地址:Session/Tcp/RemoveByTerminalPhoneNo | |||
请求地址:Tcp/Session/RemoveByTerminalPhoneNo | |||
请求方式:POST | |||
@@ -189,7 +189,7 @@ | |||
#### 1.获取会话集合 | |||
请求地址:Session/Udp/GetAll | |||
请求地址:Udp/Session/GetAll | |||
请求方式:GET | |||
@@ -223,7 +223,7 @@ | |||
#### 2.通过设备终端号移除对应会话 | |||
请求地址:Session/Udp/RemoveByTerminalPhoneNo | |||
请求地址:Udp/Session/RemoveByTerminalPhoneNo | |||
请求方式:POST | |||
@@ -253,7 +253,7 @@ | |||
#### 1.添加转发过滤地址 | |||
请求地址:Transmit/Add | |||
请求地址:Tcp/Transmit/Add | |||
请求方式:POST | |||
@@ -282,7 +282,7 @@ | |||
#### 2.删除转发过滤地址(不能删除在网关服务器配置文件配的地址) | |||
请求地址:Transmit/Remove | |||
请求地址:Tcp/Transmit/Remove | |||
请求方式:POST | |||
@@ -311,7 +311,7 @@ | |||
#### 3.获取转发过滤地址信息集合 | |||
请求地址:Transmit/GetAll | |||
请求地址:Tcp/Transmit/GetAll | |||
请求方式:GET | |||
@@ -336,7 +336,7 @@ | |||
### <span id="tcp_counter">基于Tcp消息包计数服务</span> | |||
请求地址:GetTcpAtomicCounter | |||
请求地址:Tcp/GetAtomicCounter | |||
请求方式:GET | |||
@@ -362,7 +362,7 @@ | |||
### <span id="udp_counter">基于Udp消息包计数服务</span> | |||
请求地址:GetUdpAtomicCounter | |||
请求地址:Udp/GetAtomicCounter | |||
请求方式:GET | |||
@@ -13,50 +13,55 @@ | |||
public const string SessionPrefix = "Session"; | |||
public const string TransmitPrefix = "Transmit"; | |||
public const string TcpPrefix = "Tcp"; | |||
public const string UdpPrefix = "Udp"; | |||
/// <summary> | |||
/// 添加转发过滤地址 | |||
/// </summary> | |||
public static string TransmitAdd = $"{RouteTablePrefix}/{TransmitPrefix}/Add"; | |||
public static string TransmitAdd = $"{RouteTablePrefix}/{TcpPrefix}/{TransmitPrefix}/Add"; | |||
/// <summary> | |||
/// 删除转发过滤地址(不能删除在网关服务器配置文件配的地址) | |||
/// </summary> | |||
public static string TransmitRemove = $"{RouteTablePrefix}/{TransmitPrefix}/Remove"; | |||
public static string TransmitRemove = $"{RouteTablePrefix}/{TcpPrefix}/{TransmitPrefix}/Remove"; | |||
/// <summary> | |||
/// 获取转发过滤地址信息集合 | |||
/// </summary> | |||
public static string TransmitGetAll = $"{RouteTablePrefix}/{TransmitPrefix}/GetAll"; | |||
public static string TransmitGetAll = $"{RouteTablePrefix}/{TcpPrefix}/{TransmitPrefix}/GetAll"; | |||
/// <summary> | |||
/// 获取Tcp包计数器 | |||
/// </summary> | |||
public static string GetTcpAtomicCounter = $"{RouteTablePrefix}/GetTcpAtomicCounter"; | |||
public static string GetTcpAtomicCounter = $"{RouteTablePrefix}/{TcpPrefix}/GetAtomicCounter"; | |||
/// <summary> | |||
/// 基于Tcp的会话服务集合 | |||
/// </summary> | |||
public static string SessionTcpGetAll = $"{RouteTablePrefix}/{SessionPrefix}/Tcp/GetAll"; | |||
public static string SessionTcpGetAll = $"{RouteTablePrefix}/{TcpPrefix}/{SessionPrefix}/GetAll"; | |||
/// <summary> | |||
/// 基于Tcp的会话服务-通过设备终端号移除对应会话 | |||
/// </summary> | |||
public static string SessionTcpRemoveByTerminalPhoneNo = $"{RouteTablePrefix}/{SessionPrefix}/Tcp/RemoveByTerminalPhoneNo"; | |||
public static string SessionTcpRemoveByTerminalPhoneNo = $"{RouteTablePrefix}/{TcpPrefix}/{SessionPrefix}/RemoveByTerminalPhoneNo"; | |||
/// <summary> | |||
/// 基于Tcp的统一下发信息 | |||
/// </summary> | |||
public static string UnificationTcpSend = $"{RouteTablePrefix}/UnificationTcpSend"; | |||
public static string UnificationTcpSend = $"{RouteTablePrefix}/{TcpPrefix}/UnificationSend"; | |||
/// <summary> | |||
/// 获取Udp包计数器 | |||
/// </summary> | |||
public static string GetUdpAtomicCounter = $"{RouteTablePrefix}/GetUdpAtomicCounter"; | |||
public static string GetUdpAtomicCounter = $"{RouteTablePrefix}/{UdpPrefix}/GetAtomicCounter"; | |||
/// <summary> | |||
/// 基于Udp的统一下发信息 | |||
/// </summary> | |||
public static string UnificationUdpSend = $"{RouteTablePrefix}/UnificationUdpSend"; | |||
public static string UnificationUdpSend = $"{RouteTablePrefix}/{UdpPrefix}/UnificationSend"; | |||
/// <summary> | |||
/// 基于Udp的会话服务集合 | |||
/// </summary> | |||
public static string SessionUdpGetAll = $"{RouteTablePrefix}/{SessionPrefix}/Udp/GetAll"; | |||
public static string SessionUdpGetAll = $"{RouteTablePrefix}/{UdpPrefix}/{SessionPrefix}/GetAll"; | |||
/// <summary> | |||
/// 基于Udp的会话服务-通过设备终端号移除对应会话 | |||
/// </summary> | |||
public static string SessionUdpRemoveByTerminalPhoneNo = $"{RouteTablePrefix}/{SessionPrefix}/Udp/RemoveByTerminalPhoneNo"; | |||
public static string SessionUdpRemoveByTerminalPhoneNo = $"{RouteTablePrefix}/{UdpPrefix}/{SessionPrefix}/RemoveByTerminalPhoneNo"; | |||
} | |||
} | |||
@@ -33,6 +33,8 @@ namespace JT808.DotNetty.Core | |||
private Task _executingTask; | |||
public abstract string ServiceName { get; } | |||
private readonly CancellationTokenSource _stoppingCts = new CancellationTokenSource(); | |||
protected abstract Task ExecuteAsync(CancellationToken stoppingToken); | |||
@@ -19,17 +19,19 @@ namespace JT808.DotNetty.Core.Jobs | |||
_logger =loggerFactory.CreateLogger<JT808TcpAtomicCouterResetDailyJob>(); | |||
} | |||
public override string ServiceName => nameof(JT808TcpAtomicCouterResetDailyJob); | |||
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |||
{ | |||
_logger.LogInformation($"{nameof(JT808TcpAtomicCouterResetDailyJob)} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{nameof(JT808TcpAtomicCouterResetDailyJob)} background task is stopping.")); | |||
_logger.LogInformation($"{ServiceName} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{ServiceName} background task is stopping.")); | |||
while (!stoppingToken.IsCancellationRequested) | |||
{ | |||
_logger.LogInformation($"{nameof(JT808TcpAtomicCouterResetDailyJob)} task doing background work."); | |||
_logger.LogInformation($"{ServiceName} task doing background work."); | |||
_jT808TcpAtomicCounterService.Reset(); | |||
await Task.Delay(DelayTimeSpan, stoppingToken); | |||
} | |||
_logger.LogInformation($"{nameof(JT808TcpAtomicCouterResetDailyJob)} background task is stopping."); | |||
_logger.LogInformation($"{ServiceName} background task is stopping."); | |||
} | |||
} | |||
} |
@@ -0,0 +1,37 @@ | |||
using JT808.DotNetty.Core.Services; | |||
using Microsoft.Extensions.Logging; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace JT808.DotNetty.Core.Jobs | |||
{ | |||
public class JT808TcpTrafficResetDailyJob : JT808BackgroundService | |||
{ | |||
private readonly ILogger<JT808TcpTrafficResetDailyJob> _logger; | |||
private readonly JT808TcpTrafficService _jT808TcpTrafficService; | |||
public JT808TcpTrafficResetDailyJob( | |||
JT808TcpTrafficService jT808TcpTrafficService, | |||
ILoggerFactory loggerFactory) | |||
{ | |||
_jT808TcpTrafficService = jT808TcpTrafficService; | |||
_logger =loggerFactory.CreateLogger<JT808TcpTrafficResetDailyJob>(); | |||
} | |||
public override string ServiceName => nameof(JT808TcpTrafficResetDailyJob); | |||
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |||
{ | |||
_logger.LogInformation($"{ServiceName} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{ServiceName} background task is stopping.")); | |||
while (!stoppingToken.IsCancellationRequested) | |||
{ | |||
_logger.LogInformation($"{ServiceName} task doing background work."); | |||
_jT808TcpTrafficService.ResetSize(); | |||
await Task.Delay(DelayTimeSpan, stoppingToken); | |||
} | |||
_logger.LogInformation($"{ServiceName} background task is stopping."); | |||
} | |||
} | |||
} |
@@ -23,17 +23,19 @@ namespace JT808.DotNetty.Core.Jobs | |||
_logger =loggerFactory.CreateLogger<JT808UdpAtomicCouterResetDailyJob>(); | |||
} | |||
public override string ServiceName => nameof(JT808UdpAtomicCouterResetDailyJob); | |||
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |||
{ | |||
_logger.LogInformation($"{nameof(JT808UdpAtomicCouterResetDailyJob)} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{nameof(JT808UdpAtomicCouterResetDailyJob)} background task is stopping.")); | |||
_logger.LogInformation($"{ServiceName} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{ServiceName} background task is stopping.")); | |||
while (!stoppingToken.IsCancellationRequested) | |||
{ | |||
_logger.LogInformation($"{nameof(JT808UdpAtomicCouterResetDailyJob)} task doing background work."); | |||
_logger.LogInformation($"{ServiceName} task doing background work."); | |||
_jT808UdpAtomicCounterService.Reset(); | |||
await Task.Delay(DelayTimeSpan, stoppingToken); | |||
} | |||
_logger.LogInformation($"{nameof(JT808UdpAtomicCouterResetDailyJob)} background task is stopping."); | |||
_logger.LogInformation($"{ServiceName} background task is stopping."); | |||
} | |||
} | |||
} |
@@ -0,0 +1,37 @@ | |||
using JT808.DotNetty.Core.Services; | |||
using Microsoft.Extensions.Logging; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace JT808.DotNetty.Core.Jobs | |||
{ | |||
public class JT808UdpTrafficResetDailyJob : JT808BackgroundService | |||
{ | |||
private readonly ILogger<JT808UdpTrafficResetDailyJob> _logger; | |||
private readonly JT808UdpTrafficService _jT808UdpTrafficService; | |||
public JT808UdpTrafficResetDailyJob( | |||
JT808UdpTrafficService jT808UdpTrafficService, | |||
ILoggerFactory loggerFactory) | |||
{ | |||
_jT808UdpTrafficService = jT808UdpTrafficService; | |||
_logger =loggerFactory.CreateLogger<JT808UdpTrafficResetDailyJob>(); | |||
} | |||
public override string ServiceName => nameof(JT808UdpTrafficResetDailyJob); | |||
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |||
{ | |||
_logger.LogInformation($"{ServiceName} is starting."); | |||
stoppingToken.Register(() => _logger.LogInformation($"{ServiceName} background task is stopping.")); | |||
while (!stoppingToken.IsCancellationRequested) | |||
{ | |||
_logger.LogInformation($"{ServiceName} task doing background work."); | |||
_jT808UdpTrafficService.ResetSize(); | |||
await Task.Delay(DelayTimeSpan, stoppingToken); | |||
} | |||
_logger.LogInformation($"{ServiceName} background task is stopping."); | |||
} | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
using JT808.DotNetty.Core.Metadata; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT808.DotNetty.Core.Services | |||
{ | |||
public class JT808TcpTrafficService | |||
{ | |||
private readonly JT808AtomicCounter receiveCounter = new JT808AtomicCounter(); | |||
private readonly JT808AtomicCounter sendCounter = new JT808AtomicCounter(); | |||
public void ReceiveSize(long size) | |||
{ | |||
receiveCounter.Add(size); | |||
} | |||
public void SendSize(long size) | |||
{ | |||
sendCounter.Add(size); | |||
} | |||
public void ResetSize() | |||
{ | |||
receiveCounter.Reset(); | |||
sendCounter.Reset(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
using JT808.DotNetty.Core.Metadata; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT808.DotNetty.Core.Services | |||
{ | |||
public class JT808UdpTrafficService | |||
{ | |||
private readonly JT808AtomicCounter receiveCounter = new JT808AtomicCounter(); | |||
private readonly JT808AtomicCounter sendCounter = new JT808AtomicCounter(); | |||
public void ReceiveSize(long size) | |||
{ | |||
receiveCounter.Add(size); | |||
} | |||
public void SendSize(long size) | |||
{ | |||
sendCounter.Add(size); | |||
} | |||
public void ResetSize() | |||
{ | |||
receiveCounter.Reset(); | |||
sendCounter.Reset(); | |||
} | |||
} | |||
} |
@@ -2,6 +2,7 @@ | |||
using JT808.DotNetty.Abstractions.Dtos; | |||
using JT808.DotNetty.Core; | |||
using JT808.DotNetty.Core.Interfaces; | |||
using JT808.DotNetty.Core.Services; | |||
using System; | |||
namespace JT808.DotNetty.Internal | |||
@@ -10,8 +11,13 @@ namespace JT808.DotNetty.Internal | |||
{ | |||
private readonly JT808TcpSessionManager jT808SessionManager; | |||
public JT808UnificationTcpSendService(JT808TcpSessionManager jT808SessionManager) | |||
private readonly JT808TcpTrafficService jT808TcpTrafficService; | |||
public JT808UnificationTcpSendService( | |||
JT808TcpTrafficService jT808TcpTrafficService, | |||
JT808TcpSessionManager jT808SessionManager) | |||
{ | |||
this.jT808TcpTrafficService = jT808TcpTrafficService; | |||
this.jT808SessionManager = jT808SessionManager; | |||
} | |||
@@ -22,7 +28,8 @@ namespace JT808.DotNetty.Internal | |||
{ | |||
var session = jT808SessionManager.GetSession(terminalPhoneNo); | |||
if (session != null) | |||
{ | |||
{ | |||
jT808TcpTrafficService.SendSize(data.Length); | |||
session.Channel.WriteAndFlushAsync(Unpooled.WrappedBuffer(data)); | |||
resultDto.Code = JT808ResultCode.Ok; | |||
resultDto.Data = true; | |||
@@ -3,6 +3,7 @@ using DotNetty.Transport.Channels.Sockets; | |||
using JT808.DotNetty.Abstractions.Dtos; | |||
using JT808.DotNetty.Core; | |||
using JT808.DotNetty.Core.Interfaces; | |||
using JT808.DotNetty.Core.Services; | |||
using System; | |||
namespace JT808.DotNetty.Internal | |||
@@ -11,8 +12,13 @@ namespace JT808.DotNetty.Internal | |||
{ | |||
private readonly JT808UdpSessionManager jT808SessionManager; | |||
public JT808UnificationUdpSendService(JT808UdpSessionManager jT808SessionManager) | |||
private readonly JT808UdpTrafficService jT808UdpTrafficService; | |||
public JT808UnificationUdpSendService( | |||
JT808UdpTrafficService jT808UdpTrafficService, | |||
JT808UdpSessionManager jT808SessionManager) | |||
{ | |||
this.jT808UdpTrafficService = jT808UdpTrafficService; | |||
this.jT808SessionManager = jT808SessionManager; | |||
} | |||
@@ -24,6 +30,7 @@ namespace JT808.DotNetty.Internal | |||
var session = jT808SessionManager.GetSession(terminalPhoneNo); | |||
if (session != null) | |||
{ | |||
jT808UdpTrafficService.SendSize(data.Length); | |||
session.Channel.WriteAndFlushAsync(new DatagramPacket(Unpooled.WrappedBuffer(data), session.Sender)); | |||
resultDto.Code = JT808ResultCode.Ok; | |||
resultDto.Data = true; | |||
@@ -26,9 +26,12 @@ namespace JT808.DotNetty.Tcp.Handlers | |||
private readonly JT808TcpAtomicCounterService jT808AtomicCounterService; | |||
private readonly JT808TcpTrafficService jT808TcpTrafficService; | |||
private readonly ILogger<JT808TcpServerHandler> logger; | |||
public JT808TcpServerHandler( | |||
JT808TcpTrafficService jT808TcpTrafficService, | |||
ILoggerFactory loggerFactory, | |||
JT808TransmitAddressFilterService jT808TransmitAddressFilterService, | |||
IJT808SourcePackageDispatcher jT808SourcePackageDispatcher, | |||
@@ -36,6 +39,7 @@ namespace JT808.DotNetty.Tcp.Handlers | |||
JT808TcpAtomicCounterService jT808AtomicCounterService, | |||
JT808TcpSessionManager jT808SessionManager) | |||
{ | |||
this.jT808TcpTrafficService = jT808TcpTrafficService; | |||
this.jT808TransmitAddressFilterService = jT808TransmitAddressFilterService; | |||
this.handler = handler; | |||
this.jT808SessionManager = jT808SessionManager; | |||
@@ -55,6 +59,7 @@ namespace JT808.DotNetty.Tcp.Handlers | |||
//解析具体的消息体,具体调用JT808Serializer.Deserialize<T> | |||
JT808HeaderPackage jT808HeaderPackage = JT808Serializer.Deserialize<JT808HeaderPackage>(msg); | |||
jT808AtomicCounterService.MsgSuccessIncrement(); | |||
jT808TcpTrafficService.ReceiveSize(msg.Length); | |||
if (logger.IsEnabled(LogLevel.Debug)) | |||
{ | |||
logger.LogDebug("accept package success count<<<" + jT808AtomicCounterService.MsgSuccessCount.ToString()); | |||
@@ -68,7 +73,9 @@ namespace JT808.DotNetty.Tcp.Handlers | |||
{ | |||
if (!jT808TransmitAddressFilterService.ContainsKey(ctx.Channel.RemoteAddress)) | |||
{ | |||
ctx.WriteAndFlushAsync(Unpooled.WrappedBuffer(JT808Serializer.Serialize(jT808Response.Package, jT808Response.MinBufferSize))); | |||
var sendData = JT808Serializer.Serialize(jT808Response.Package, jT808Response.MinBufferSize); | |||
jT808TcpTrafficService.SendSize(sendData.Length); | |||
ctx.WriteAndFlushAsync(Unpooled.WrappedBuffer(sendData)); | |||
} | |||
} | |||
} | |||
@@ -24,11 +24,13 @@ namespace JT808.DotNetty.Tcp | |||
serviceDescriptors.TryAddSingleton<JT808TcpSessionManager>(); | |||
serviceDescriptors.TryAddSingleton<JT808TcpAtomicCounterService>(); | |||
serviceDescriptors.TryAddSingleton<JT808TransmitAddressFilterService>(); | |||
serviceDescriptors.TryAddSingleton<JT808TcpTrafficService>(); | |||
serviceDescriptors.TryAddSingleton<JT808MsgIdTcpHandlerBase, JT808MsgIdDefaultTcpHandler>(); | |||
serviceDescriptors.TryAddScoped<JT808TcpConnectionHandler>(); | |||
serviceDescriptors.TryAddScoped<JT808TcpDecoder>(); | |||
serviceDescriptors.TryAddScoped<JT808TcpServerHandler>(); | |||
serviceDescriptors.AddHostedService<JT808TcpAtomicCouterResetDailyJob>(); | |||
serviceDescriptors.AddHostedService<JT808TcpTrafficResetDailyJob>(); | |||
serviceDescriptors.AddHostedService<JT808TcpServerHost>(); | |||
return serviceDescriptors; | |||
} | |||
@@ -28,13 +28,17 @@ namespace JT808.DotNetty.Udp.Handlers | |||
private readonly JT808MsgIdUdpHandlerBase handler; | |||
private readonly JT808UdpTrafficService jT808UdpTrafficService; | |||
public JT808UdpServerHandler( | |||
JT808UdpTrafficService jT808UdpTrafficService, | |||
ILoggerFactory loggerFactory, | |||
IJT808SourcePackageDispatcher jT808SourcePackageDispatcher, | |||
JT808MsgIdUdpHandlerBase handler, | |||
JT808UdpAtomicCounterService jT808UdpAtomicCounterService, | |||
JT808UdpSessionManager jT808UdpSessionManager) | |||
{ | |||
this.jT808UdpTrafficService = jT808UdpTrafficService; | |||
this.handler = handler; | |||
this.jT808SourcePackageDispatcher = jT808SourcePackageDispatcher; | |||
this.jT808UdpAtomicCounterService = jT808UdpAtomicCounterService; | |||
@@ -47,6 +51,7 @@ namespace JT808.DotNetty.Udp.Handlers | |||
try | |||
{ | |||
jT808SourcePackageDispatcher?.SendAsync(msg.Buffer); | |||
jT808UdpTrafficService.ReceiveSize(msg.Buffer.Length); | |||
//解析到头部,然后根据具体的消息Id通过队列去进行消费 | |||
//要是一定要解析到数据体可以在JT808MsgIdHandlerBase类中根据具体的消息, | |||
//解析具体的消息体,具体调用JT808Serializer.Deserialize<T> | |||
@@ -63,7 +68,9 @@ namespace JT808.DotNetty.Udp.Handlers | |||
JT808Response jT808Response = handlerFunc(new JT808Request(jT808HeaderPackage, msg.Buffer)); | |||
if (jT808Response != null) | |||
{ | |||
ctx.WriteAndFlushAsync(new DatagramPacket(Unpooled.WrappedBuffer(JT808Serializer.Serialize(jT808Response.Package, jT808Response.MinBufferSize)), msg.Sender)); | |||
var sendData = JT808Serializer.Serialize(jT808Response.Package, jT808Response.MinBufferSize); | |||
jT808UdpTrafficService.SendSize(sendData.Length); | |||
ctx.WriteAndFlushAsync(new DatagramPacket(Unpooled.WrappedBuffer(sendData), msg.Sender)); | |||
} | |||
} | |||
} | |||
@@ -18,10 +18,12 @@ namespace JT808.DotNetty.Udp | |||
{ | |||
serviceDescriptors.TryAddSingleton<JT808UdpSessionManager>(); | |||
serviceDescriptors.TryAddSingleton<JT808UdpAtomicCounterService>(); | |||
serviceDescriptors.TryAddSingleton<JT808UdpTrafficService>(); | |||
serviceDescriptors.TryAddSingleton<JT808MsgIdUdpHandlerBase, JT808MsgIdDefaultUdpHandler>(); | |||
serviceDescriptors.TryAddScoped<JT808UdpDecoder>(); | |||
serviceDescriptors.TryAddScoped<JT808UdpServerHandler>(); | |||
serviceDescriptors.AddHostedService<JT808UdpAtomicCouterResetDailyJob>(); | |||
serviceDescriptors.AddHostedService<JT808UdpTrafficResetDailyJob>(); | |||
serviceDescriptors.AddHostedService<JT808UdpServerHost>(); | |||
return serviceDescriptors; | |||
} | |||