Skip to content

Commit

Permalink
Adjust namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Aug 5, 2024
1 parent 65fea6b commit 8ee7985
Show file tree
Hide file tree
Showing 158 changed files with 226 additions and 323 deletions.
1 change: 0 additions & 1 deletion Samples/Client/Client_Connection_Samples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using MQTTnet.Client;
using MQTTnet.Formatter;
using MQTTnet.Samples.Helpers;

Expand Down
14 changes: 6 additions & 8 deletions Samples/Client/Client_Publish_Samples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming

using MQTTnet.Client;

namespace MQTTnet.Samples.Client;

public static class Client_Publish_Samples
Expand Down Expand Up @@ -41,11 +39,11 @@ public static async Task Publish_Application_Message()
await mqttClient.PublishAsync(applicationMessage, CancellationToken.None);

await mqttClient.DisconnectAsync();

Console.WriteLine("MQTT application message is published.");
}
}

public static async Task Publish_Multiple_Application_Messages()
{
/*
Expand All @@ -70,23 +68,23 @@ public static async Task Publish_Multiple_Application_Messages()
.Build();

await mqttClient.PublishAsync(applicationMessage, CancellationToken.None);

applicationMessage = new MqttApplicationMessageBuilder()
.WithTopic("samples/temperature/living_room")
.WithPayload("20.0")
.Build();

await mqttClient.PublishAsync(applicationMessage, CancellationToken.None);

applicationMessage = new MqttApplicationMessageBuilder()
.WithTopic("samples/temperature/living_room")
.WithPayload("21.0")
.Build();

await mqttClient.PublishAsync(applicationMessage, CancellationToken.None);

await mqttClient.DisconnectAsync();

Console.WriteLine("MQTT application message is published.");
}
}
Expand Down
1 change: 0 additions & 1 deletion Samples/Client/Client_Subscribe_Samples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Local

using MQTTnet.Client;
using MQTTnet.Extensions.TopicTemplate;
using MQTTnet.Packets;
using MQTTnet.Protocol;
Expand Down
15 changes: 7 additions & 8 deletions Samples/RpcClient/RpcClient_Samples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming

using MQTTnet.Client;
using MQTTnet.Extensions.Rpc;
using MQTTnet.Protocol;

Expand All @@ -19,38 +18,38 @@ public static class RpcClient_Samples
* This is done via defining a pattern which uses the topic to correlate the request and the response.
* From client usage it is possible to define a timeout.
*/

public static async Task Send_Request()
{
var mqttFactory = new MqttClientFactory();

// The RPC client is an addon for the existing client. So we need a regular client
// which is wrapped later.

using (var mqttClient = mqttFactory.CreateMqttClient())
{
var mqttClientOptions = new MqttClientOptionsBuilder()
.WithTcpServer("broker.hivemq.com")
.Build();

await mqttClient.ConnectAsync(mqttClientOptions);

using (var mqttRpcClient = mqttFactory.CreateMqttRpcClient(mqttClient))
{
// Access to a fully featured application message is not supported for RPC calls!
// The method will throw an exception when the response was not received in time.
await mqttRpcClient.ExecuteAsync(TimeSpan.FromSeconds(2), "ping", "", MqttQualityOfServiceLevel.AtMostOnce);
}

Console.WriteLine("The RPC call was successful.");
}
}

/*
* The device must respond to the request using the correct topic. The following C code shows how a
* smart device like an ESP8266 must respond to the above sample.
*
// If using the MQTT client PubSubClient it must be ensured
// If using the MQTT client PubSubClient it must be ensured
// that the request topic for each method is subscribed like the following.
mqttClient.subscribe("MQTTnet.RPC/+/ping");
mqttClient.subscribe("MQTTnet.RPC/+/do_something");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Runtime.InteropServices;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public static class BufferExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System.IO.Pipelines;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public class DuplexPipe : IDuplexPipe
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
// 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.Adapter;
using MQTTnet.AspNetCore.Client.Tcp;
using MQTTnet.Formatter;
using System;
using MQTTnet.Client;
using MQTTnet.Adapter;
using MQTTnet.Diagnostics.Logger;
using MQTTnet.Formatter;

namespace MQTTnet.AspNetCore.Client
namespace MQTTnet.AspNetCore
{
public sealed class MqttClientConnectionContextFactory : IMqttClientAdapterFactory
{
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.AspnetCore/MqttConnectionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Microsoft.AspNetCore.Http.Connections.Features;
using Microsoft.AspNetCore.Http.Features;
using MQTTnet.Adapter;
using MQTTnet.AspNetCore.Client.Tcp;
using MQTTnet.Exceptions;
using MQTTnet.Formatter;
using MQTTnet.Internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public class SocketAwaitable : ICriticalNotifyCompletion
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.AspNetCore.Http.Features;
using MQTTnet.Exceptions;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public sealed class SocketConnection : ConnectionContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.IO.Pipelines;
using System.Net.Sockets;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public sealed class SocketReceiver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Net.Sockets;
using System.Runtime.InteropServices;

namespace MQTTnet.AspNetCore.Client.Tcp;
namespace MQTTnet.AspNetCore;

public sealed class SocketSender
{
Expand Down
10 changes: 1 addition & 9 deletions Source/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,13 @@
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
<DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers>
<NoWarn>1591;NETSDK1138;NU1803;NU1901;NU1902</NoWarn>
<NoWarn>1591;NETSDK1138;NU1803;NU1901;NU1902;CS8892</NoWarn>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NuGetAuditMode>all</NuGetAuditMode>
<NuGetAudit>true</NuGetAudit>
<AnalysisLevel>latest-Recommended</AnalysisLevel>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>1591;NETSDK1138</NoWarn>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<NoWarn>1591;NETSDK1138</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12"/>
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Benchmarks/MessageDeliveryBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using MQTTnet.Client;
using MQTTnet.Packets;
using MQTTnet.Server;

Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Benchmarks/MessageProcessingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using MQTTnet.Client;
using MQTTnet.Server;

namespace MQTTnet.Benchmarks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using MQTTnet.Client;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using MQTTnet.AspNetCore.Client;
using MQTTnet.AspNetCore;
using MQTTnet.Diagnostics.Logger;

Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Benchmarks/MqttTcpChannelBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using MQTTnet.Channel;
using MQTTnet.Client;
using MQTTnet.Diagnostics.Logger;
using MQTTnet.Implementations;
using MQTTnet.Server;
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Benchmarks/SubscribeBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using MQTTnet.Client;
using MQTTnet.Server;

namespace MQTTnet.Benchmarks;
Expand Down
2 changes: 1 addition & 1 deletion Source/MQTTnet.Benchmarks/TcpPipesBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using MQTTnet.AspNetCore.Client.Tcp;
using MQTTnet.AspNetCore;

namespace MQTTnet.Benchmarks
{
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Benchmarks/UnsubscribeBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using MQTTnet.Client;
using MQTTnet.Server;

namespace MQTTnet.Benchmarks;
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Extensions.Rpc/MqttFactoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System;
using MQTTnet.Client;

namespace MQTTnet.Extensions.Rpc
{
Expand Down
1 change: 0 additions & 1 deletion Source/MQTTnet.Extensions.Rpc/MqttRpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MQTTnet.Client;
using MQTTnet.Exceptions;
using MQTTnet.Formatter;
using MQTTnet.Internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Collections.Generic;
using MQTTnet.Client;
using MQTTnet.Protocol;

namespace MQTTnet.Extensions.Rpc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@
<NoWarn>1591;NETSDK1138</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NugetTargetMoniker>UAP,Version=v10.0</NugetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);WINDOWS_UWP</DefineConstants>
<DefaultLanguage>en</DefaultLanguage>
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
</PropertyGroup>

<ItemGroup>
<None Include="README.md">
<Pack>True</Pack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Linq;
using MQTTnet.Client;
using MQTTnet.Packets;
using MQTTnet.Protocol;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.Client;
using MQTTnet.Packets;
using MQTTnet.Protocol;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.Client;
using MQTTnet.Packets;
using MQTTnet.Protocol;

Expand Down
Loading

0 comments on commit 8ee7985

Please sign in to comment.