Skip to content

Commit

Permalink
升级库
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallChi committed Jun 7, 2023
1 parent 7711ff5 commit 5e19ace
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotPulsar" Version="2.5.2" />
<PackageReference Include="DotPulsar" Version="2.11.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<Import Project="..\pipeline.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<Import Project="..\pipeline.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<Import Project="..\pipeline.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<Import Project="..\pipeline.props" />
Expand Down
5 changes: 2 additions & 3 deletions src/JT808.Gateway.Abstractions/IJT808ClientBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
Expand All @@ -9,7 +8,7 @@ namespace JT808.Gateway.Abstractions
{
public interface IJT808ClientBuilder
{
IJT808DIBuilder JT808Builder { get; }
IJT808DIBuilder Builder();
IJT808Builder JT808Builder { get; }
IJT808Builder Builder();
}
}
5 changes: 2 additions & 3 deletions src/JT808.Gateway.Abstractions/IJT808GatewayBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
Expand All @@ -9,7 +8,7 @@ namespace JT808.Gateway.Abstractions
{
public interface IJT808GatewayBuilder
{
IJT808DIBuilder JT808Builder { get; }
IJT808DIBuilder Builder();
IJT808Builder JT808Builder { get; }
IJT808Builder Builder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JT808" Version="2.6.1" />
<PackageReference Include="JT808.Protocol.DependencyInjection" Version="2.6.1" />
<PackageReference Include="JT808" Version="2.6.2-preview5" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/JT808.Gateway.Client/IJT808ClientBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
Expand All @@ -9,7 +8,7 @@ namespace JT808.Gateway.Client
{
public interface IJT808ClientBuilder
{
IJT808DIBuilder JT808Builder { get; }
IJT808DIBuilder Builder();
IJT808Builder JT808Builder { get; }
IJT808Builder Builder();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
Expand All @@ -10,14 +9,14 @@ namespace JT808.Gateway.Client
{
internal class JT808ClientBuilderDefault : IJT808ClientBuilder
{
public IJT808DIBuilder JT808Builder { get; }
public IJT808Builder JT808Builder { get; }

public JT808ClientBuilderDefault(IJT808DIBuilder builder)
public JT808ClientBuilderDefault(IJT808Builder builder)
{
JT808Builder = builder;
}

public IJT808DIBuilder Builder()
public IJT808Builder Builder()
{
return JT808Builder;
}
Expand Down
3 changes: 1 addition & 2 deletions src/JT808.Gateway.Client/JT808.Gateway.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JT808" Version="2.6.1" />
<PackageReference Include="JT808.Protocol.DependencyInjection" Version="2.6.1" />
<PackageReference Include="JT808" Version="2.6.2-preview5" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
Expand Down
3 changes: 1 addition & 2 deletions src/JT808.Gateway.Client/JT808ClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
using JT808.Gateway.Client.Services;
using Microsoft.Extensions.DependencyInjection.Extensions;
using JT808.Gateway.Client.Internal;
using JT808.Protocol.DependencyInjection;

namespace JT808.Gateway.Client
{
public static class JT808ClientExtensions
{
public static IJT808ClientBuilder AddClient(this IJT808DIBuilder jT808Builder)
public static IJT808ClientBuilder AddClient(this IJT808Builder jT808Builder)
{
JT808ClientBuilderDefault jT808ClientBuilderDefault = new JT808ClientBuilderDefault(jT808Builder);
jT808ClientBuilderDefault.JT808Builder.Services.AddSingleton<JT808RetryBlockingCollection>();
Expand Down
2 changes: 1 addition & 1 deletion src/JT808.Gateway.Kafka/JT808.Gateway.Kafka.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<DocumentationFile>JT808.Gateway.Kafka.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Confluent.Kafka" Version="2.1.0" />
<PackageReference Include="Confluent.Kafka" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 3 additions & 4 deletions src/JT808.Gateway.Kafka/JT808ClientBuilderDefault.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using JT808.Gateway.Abstractions;
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
Expand All @@ -11,14 +10,14 @@ namespace JT808.Gateway.Kafka
{
internal class JT808ClientBuilderDefault : IJT808ClientBuilder
{
public IJT808DIBuilder JT808Builder { get; }
public IJT808Builder JT808Builder { get; }

public JT808ClientBuilderDefault(IJT808DIBuilder builder)
public JT808ClientBuilderDefault(IJT808Builder builder)
{
JT808Builder = builder;
}

public IJT808DIBuilder Builder()
public IJT808Builder Builder()
{
return JT808Builder;
}
Expand Down
3 changes: 1 addition & 2 deletions src/JT808.Gateway.Kafka/JT808ClientKafkaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using JT808.Protocol.DependencyInjection;

namespace JT808.Gateway.Kafka
{
public static class JT808ClientKafkaExtensions
{
public static IJT808ClientBuilder AddClientKafka(this IJT808DIBuilder builder)
public static IJT808ClientBuilder AddClientKafka(this IJT808Builder builder)
{
return new JT808ClientBuilderDefault(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public void TryLinkTest()
public void PerfSession1M()
{
//Random.Shared.Next(0,1000000)
int number = 1000000;
JT808SessionManager jT808SessionManager = new JT808SessionManager(new LoggerFactory());
Parallel.For(0, number, (i) =>
{
string tno = i.ToString();
var session = new JT808TcpSession(new Socket(SocketType.Stream, ProtocolType.Tcp));
var result1 = jT808SessionManager.TryAdd(session);
jT808SessionManager.TryLink(tno, session);
});
//int number = 1000000;
//JT808SessionManager jT808SessionManager = new JT808SessionManager(new LoggerFactory());
//Parallel.For(0, number, (i) =>
//{
// string tno = i.ToString();
// var session = new JT808TcpSession(new Socket(SocketType.Stream, ProtocolType.Tcp));
// var result1 = jT808SessionManager.TryAdd(session);
// jT808SessionManager.TryLink(tno, session);
//});
}

/// <summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using JT808.Gateway.Abstractions;
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
Expand Down Expand Up @@ -61,7 +60,7 @@ public static IServiceCollection AddJT808WebApiClientTool(this IServiceCollectio
/// <param name="jT808Builder"></param>
/// <param name="configuration"></param>
/// <returns></returns>
public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, IConfiguration configuration)
public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, IConfiguration configuration)
{
jT808Builder.Services.AddHttpClient("JT808WebApiClientTool", c =>
{
Expand All @@ -81,7 +80,7 @@ public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Buil
/// <param name="webapiUri"></param>
/// <param name="token"></param>
/// <returns></returns>
public static IJT808DIBuilder AddWebApiClientTool(this IJT808DIBuilder jT808Builder, Uri webapiUri, string token)
public static IJT808Builder AddWebApiClientTool(this IJT808Builder jT808Builder, Uri webapiUri, string token)
{
jT808Builder.Services.AddHttpClient("JT808WebApiClientTool", c =>
{
Expand Down Expand Up @@ -141,7 +140,7 @@ public static IServiceCollection AddJT808WebApiClientTool<TJT808HttpClient>(this
/// <param name="jT808Builder"></param>
/// <param name="configuration"></param>
/// <returns></returns>
public static IJT808DIBuilder AddWebApiClientTool<TJT808HttpClient>(this IJT808DIBuilder jT808Builder, IConfiguration configuration)
public static IJT808Builder AddWebApiClientTool<TJT808HttpClient>(this IJT808Builder jT808Builder, IConfiguration configuration)
where TJT808HttpClient : JT808HttpClient
{
jT808Builder.Services.AddHttpClient("JT808WebApiClientToolExt", c =>
Expand All @@ -162,7 +161,7 @@ public static IJT808DIBuilder AddWebApiClientTool<TJT808HttpClient>(this IJT808D
/// <param name="webapiUri"></param>
/// <param name="token"></param>
/// <returns></returns>
public static IJT808DIBuilder AddWebApiClientTool<TJT808HttpClient>(this IJT808DIBuilder jT808Builder, Uri webapiUri, string token)
public static IJT808Builder AddWebApiClientTool<TJT808HttpClient>(this IJT808Builder jT808Builder, Uri webapiUri, string token)
where TJT808HttpClient: JT808HttpClient
{
jT808Builder.Services.AddHttpClient("JT808WebApiClientToolExt", c =>
Expand Down
7 changes: 3 additions & 4 deletions src/JT808.Gateway/Internal/JT808GatewayBuilderDefault.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using JT808.Gateway.Abstractions;
using JT808.Protocol;
using JT808.Protocol.DependencyInjection;

namespace JT808.Gateway.Internal
{
public class JT808GatewayBuilderDefault : IJT808GatewayBuilder
{
public IJT808DIBuilder JT808Builder { get; }
public IJT808Builder JT808Builder { get; }

public JT808GatewayBuilderDefault(IJT808DIBuilder builder)
public JT808GatewayBuilderDefault(IJT808Builder builder)
{
JT808Builder = builder;
}

public IJT808DIBuilder Builder()
public IJT808Builder Builder()
{
return JT808Builder;
}
Expand Down
4 changes: 2 additions & 2 deletions src/JT808.Gateway/JT808.Gateway.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5e19ace

Please sign in to comment.