Skip to content

Commit

Permalink
Drop support for dotnet7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed May 20, 2024
1 parent 1b449ef commit 668e755
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 130 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet.AspNetCore</AssemblyName>
<RootNamespace>MQTTnet.AspNetCore</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
<DebugType>Full</DebugType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static void RenderMenu()
{
Console.Clear();

Console.WriteLine($"MQTTnet - Benchmarks ({TargetFrameworkProvider.TargetFramework})");
Console.WriteLine($"MQTTnet - Benchmarks");
Console.WriteLine("-----------------------------------------------");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Press arrow keys for benchmark selection");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet.Extensions.ManagedClient</AssemblyName>
<RootNamespace>MQTTnet.Extensions.ManagedClient</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet.Extensions.Rpc</AssemblyName>
<RootNamespace>MQTTnet.Extensions.Rpc</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet.Extensions.TopicTemplate</AssemblyName>
<RootNamespace>MQTTnet.Extensions.TopicTemplate</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.Server/MQTTnet.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet.Server</AssemblyName>
<RootNamespace>MQTTnet.Server</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
170 changes: 84 additions & 86 deletions Source/MQTTnet.TestApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,97 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using MQTTnet.Diagnostics;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace MQTTnet.TestApp
namespace MQTTnet.TestApp;

public static class Program
{
public static class Program
public static void Main()
{
public static void Main()
{
Console.WriteLine($"MQTTnet - TestApp.{TargetFrameworkProvider.TargetFramework}");
Console.WriteLine("1 = Start client");
Console.WriteLine("2 = Start server");
Console.WriteLine("3 = Start performance test");
Console.WriteLine("4 = Start managed client");
Console.WriteLine("5 = Start public broker test");
Console.WriteLine("6 = Start server & client");
Console.WriteLine("7 = Client flow test");
Console.WriteLine("8 = Start performance test (client only)");
Console.WriteLine("9 = Start server (no trace)");
Console.WriteLine("a = Start QoS 2 benchmark");
Console.WriteLine("b = Start QoS 1 benchmark");
Console.WriteLine("c = Start QoS 0 benchmark");
Console.WriteLine("d = Start server with logging");
Console.WriteLine("e = Start Message Throughput Test");
Console.WriteLine("f = Start AsyncLock Test");

var pressedKey = Console.ReadKey(true);
if (pressedKey.KeyChar == '1')
{
Task.Run(ClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '2')
{
Task.Run(ServerTest.RunAsync);
}
else if (pressedKey.KeyChar == '3')
{
Task.Run(PerformanceTest.RunClientAndServer);
}
else if (pressedKey.KeyChar == '4')
{
Task.Run(ManagedClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '5')
{
Task.Run(PublicBrokerTest.RunAsync);
}
else if (pressedKey.KeyChar == '6')
{
Task.Run(ServerAndClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '7')
{
Task.Run(ClientFlowTest.RunAsync);
}
else if (pressedKey.KeyChar == '8')
{
PerformanceTest.RunClientOnly();
return;
}
else if (pressedKey.KeyChar == '9')
{
ServerTest.RunEmptyServer();
return;
}
else if (pressedKey.KeyChar == 'a')
{
Task.Run(PerformanceTest.RunQoS2Test);
}
else if (pressedKey.KeyChar == 'b')
{
Task.Run(PerformanceTest.RunQoS1Test);
}
else if (pressedKey.KeyChar == 'c')
{
Task.Run(PerformanceTest.RunQoS0Test);
}
else if (pressedKey.KeyChar == 'd')
{
Task.Run(ServerTest.RunEmptyServerWithLogging);
}
else if (pressedKey.KeyChar == 'e')
{
Task.Run(new MessageThroughputTest().Run);
}
else if (pressedKey.KeyChar == 'f')
{
Task.Run(new AsyncLockTest().Run);
}
Console.WriteLine("MQTTnet - TestApp");
Console.WriteLine("1 = Start client");
Console.WriteLine("2 = Start server");
Console.WriteLine("3 = Start performance test");
Console.WriteLine("4 = Start managed client");
Console.WriteLine("5 = Start public broker test");
Console.WriteLine("6 = Start server & client");
Console.WriteLine("7 = Client flow test");
Console.WriteLine("8 = Start performance test (client only)");
Console.WriteLine("9 = Start server (no trace)");
Console.WriteLine("a = Start QoS 2 benchmark");
Console.WriteLine("b = Start QoS 1 benchmark");
Console.WriteLine("c = Start QoS 0 benchmark");
Console.WriteLine("d = Start server with logging");
Console.WriteLine("e = Start Message Throughput Test");
Console.WriteLine("f = Start AsyncLock Test");

Thread.Sleep(Timeout.Infinite);
var pressedKey = Console.ReadKey(true);
if (pressedKey.KeyChar == '1')
{
Task.Run(ClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '2')
{
Task.Run(ServerTest.RunAsync);
}
else if (pressedKey.KeyChar == '3')
{
Task.Run(PerformanceTest.RunClientAndServer);
}
else if (pressedKey.KeyChar == '4')
{
Task.Run(ManagedClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '5')
{
Task.Run(PublicBrokerTest.RunAsync);
}
else if (pressedKey.KeyChar == '6')
{
Task.Run(ServerAndClientTest.RunAsync);
}
else if (pressedKey.KeyChar == '7')
{
Task.Run(ClientFlowTest.RunAsync);
}
else if (pressedKey.KeyChar == '8')
{
PerformanceTest.RunClientOnly();
return;
}
else if (pressedKey.KeyChar == '9')
{
ServerTest.RunEmptyServer();
return;
}
else if (pressedKey.KeyChar == 'a')
{
Task.Run(PerformanceTest.RunQoS2Test);
}
else if (pressedKey.KeyChar == 'b')
{
Task.Run(PerformanceTest.RunQoS1Test);
}
else if (pressedKey.KeyChar == 'c')
{
Task.Run(PerformanceTest.RunQoS0Test);
}
else if (pressedKey.KeyChar == 'd')
{
Task.Run(ServerTest.RunEmptyServerWithLogging);
}
else if (pressedKey.KeyChar == 'e')
{
Task.Run(new MessageThroughputTest().Run);
}
else if (pressedKey.KeyChar == 'f')
{
Task.Run(new AsyncLockTest().Run);
}

Thread.Sleep(Timeout.Infinite);
}
}
2 changes: 1 addition & 1 deletion Source/MQTTnet.Tests/MQTTnet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
Expand Down
4 changes: 1 addition & 3 deletions Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ public sealed class MqttClientTlsOptions

public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12 | SslProtocols.Tls13;

#if NET7_0_OR_GREATER
public X509Certificate2Collection TrustChain { get; set; }
#endif
public X509Certificate2Collection TrustChain { get; set; }
}
14 changes: 6 additions & 8 deletions Source/MQTTnet/Client/Options/MqttClientTlsOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class MqttClientTlsOptionsBuilder
{
readonly MqttClientTlsOptions _tlsOptions = new()
{
// If someone used this builder the change is very very high that TLS
// If someone used this builder the change is very high that TLS
// should be actually used.
UseTls = true
};
Expand Down Expand Up @@ -140,11 +140,9 @@ public MqttClientTlsOptionsBuilder WithCipherSuitesPolicy(EncryptionPolicy encry
return this;
}

#if NET7_0_OR_GREATER
public MqttClientTlsOptionsBuilder WithTrustChain(X509Certificate2Collection chain)
{
_tlsOptions.TrustChain = chain;
return this;
}
#endif
public MqttClientTlsOptionsBuilder WithTrustChain(X509Certificate2Collection chain)
{
_tlsOptions.TrustChain = chain;
return this;
}
}
20 changes: 0 additions & 20 deletions Source/MQTTnet/Diagnostics/Runtime/TargetFrameworkProvider.cs

This file was deleted.

2 changes: 0 additions & 2 deletions Source/MQTTnet/Implementations/MqttTcpChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public async Task ConnectAsync(CancellationToken cancellationToken)
AllowRenegotiation = _tcpOptions.TlsOptions.AllowRenegotiation
};

#if NET7_0_OR_GREATER
if (_tcpOptions.TlsOptions.TrustChain?.Count > 0)
{
sslOptions.CertificateChainPolicy = new X509ChainPolicy
Expand All @@ -159,7 +158,6 @@ public async Task ConnectAsync(CancellationToken cancellationToken)

sslOptions.CertificateChainPolicy.CustomTrustStore.AddRange(_tcpOptions.TlsOptions.TrustChain);
}
#endif

await sslStream.AuthenticateAsClientAsync(sslOptions, cancellationToken).ConfigureAwait(false);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet/MQTTnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</Target>

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>MQTTnet</AssemblyName>
<RootNamespace>MQTTnet</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down

0 comments on commit 668e755

Please sign in to comment.