Browse Source

Move managed client to separate nuget.

release/3.x.x
Christian Kratky 6 years ago
parent
commit
b05cb0d2ea
19 changed files with 156 additions and 31 deletions
  1. +3
    -3
      Build/MQTTnet.AspNetCore.nuspec
  2. +53
    -0
      Build/MQTTnet.Extensions.ManagedClient.nuspec
  3. +11
    -11
      Build/MQTTnet.Extensions.Rpc.nuspec
  4. +4
    -1
      Build/MQTTnet.nuspec
  5. +9
    -1
      Build/build.ps1
  6. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ApplicationMessageProcessedEventArgs.cs
  7. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs
  8. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientOptions.cs
  9. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientStorage.cs
  10. +31
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj
  11. +11
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs
  12. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs
  13. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientExtensions.cs
  14. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptions.cs
  15. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptionsBuilder.cs
  16. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientStorageManager.cs
  17. +24
    -0
      Extensions/MQTTnet.Extensions.ManagedClient/MqttFactoryExtensions.cs
  18. +1
    -1
      Extensions/MQTTnet.Extensions.ManagedClient/ReconnectionResult.cs
  19. +0
    -5
      Frameworks/MQTTnet.NetStandard/Client/IMqttClientFactory.cs

+ 3
- 3
Build/MQTTnet.AspNetCore.nuspec View File

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>MQTTnet.AspNetCore</id> <id>MQTTnet.AspNetCore</id>
<version>2.7.5</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors> <authors>Christian Kratky</authors>
<owners>Christian Kratky</owners> <owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
@@ -10,13 +10,13 @@
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl> <iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance> <requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is a support library to integrate MQTTnet into AspNetCore.</description> <description>This is a support library to integrate MQTTnet into AspNetCore.</description>
<releaseNotes>* Updated to MQTTnet 2.7.5.
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes> </releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright> <copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags> <tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies> <dependencies>
<group targetFramework="netstandard2.0"> <group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
</dependencies> </dependencies>
</metadata> </metadata>


+ 53
- 0
Build/MQTTnet.Extensions.ManagedClient.nuspec View File

@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>MQTTnet.Extensions.ManagedClient</id>
<version>0.0.0</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is an extension library which provides a managed MQTT client with additional features using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard1.3">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="uap10.0">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net452">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
<group targetFramework="net461">
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group>
</dependencies>
</metadata>

<files>
<!-- .NET Standard 1.3 -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\netstandard1.3\MQTTnet.Extensions.ManagedClient.*" target="lib\netstandard1.3\"/>

<!-- .NET Standard 2.0 -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\netstandard2.0\MQTTnet.Extensions.ManagedClient.*" target="lib\netstandard2.0\"/>

<!-- Universal Windows -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\uap10.0\MQTTnet.Extensions.ManagedClient.*" target="lib\uap10.0\"/>

<!-- .NET Framework -->
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\net452\MQTTnet.Extensions.ManagedClient.*" target="lib\net452\"/>
<file src="..\Extensions\MQTTnet.Extensions.ManagedClient\bin\Release\net461\MQTTnet.Extensions.ManagedClient.*" target="lib\net461\"/>
</files>
</package>

+ 11
- 11
Build/MQTTnet.Extensions.Rpc.nuspec View File

@@ -2,46 +2,46 @@
<package > <package >
<metadata> <metadata>
<id>MQTTnet.Extensions.Rpc</id> <id>MQTTnet.Extensions.Rpc</id>
<version>2.7.5</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors> <authors>Christian Kratky</authors>
<owners>Christian Kratky</owners> <owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl> <projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl> <iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance> <requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is a extension library which allows executing synchronous device calls including a response using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.7.5.
<description>This is an extension library which allows executing synchronous device calls including a response using MQTTnet.</description>
<releaseNotes>* Updated to MQTTnet 2.8.0.
</releaseNotes> </releaseNotes>
<copyright>Copyright Christian Kratky 2016-2018</copyright> <copyright>Copyright Christian Kratky 2016-2018</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags> <tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies> <dependencies>
<group targetFramework="netstandard2.0"> <group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
<group targetFramework="netstandard1.3"> <group targetFramework="netstandard1.3">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
<group targetFramework="netstandard2.0"> <group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
<group targetFramework="uap10.0"> <group targetFramework="uap10.0">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
<group targetFramework="net452"> <group targetFramework="net452">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
<group targetFramework="net461"> <group targetFramework="net461">
<dependency id="MQTTnet" version="2.7.5" />
<dependency id="MQTTnet" version="2.8.0-alpha5" />
</group> </group>
</dependencies> </dependencies>
</metadata> </metadata>


<files> <files>
<!-- .NET Standard 1.3 --> <!-- .NET Standard 1.3 -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\MQTTnet.Extensions.Rpc.*" target="lib\netstandard1.3\"/>
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\netstandard1.3\MQTTnet.Extensions.Rpc.*" target="lib\netstandard1.3\"/>


<!-- .NET Standard 2.0 --> <!-- .NET Standard 2.0 -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\MQTTnet.Extensions.Rpc.*" target="lib\netstandard2.0\"/>
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\netstandard2.0\MQTTnet.Extensions.Rpc.*" target="lib\netstandard2.0\"/>


<!-- Universal Windows --> <!-- Universal Windows -->
<file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\uap10.0\MQTTnet.Extensions.Rpc.*" target="lib\uap10.0\"/> <file src="..\Extensions\MQTTnet.Extensions.Rpc\bin\Release\uap10.0\MQTTnet.Extensions.Rpc.*" target="lib\uap10.0\"/>


+ 4
- 1
Build/MQTTnet.nuspec View File

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>MQTTnet</id> <id>MQTTnet</id>
<version>2.8.0</version>
<version>0.0.0</version>
<authors>Christian Kratky</authors> <authors>Christian Kratky</authors>
<owners>Christian Kratky</owners> <owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
@@ -17,6 +17,9 @@
* [Core] The adapter now has an _Endpoint_ definition as string containing remote IP and port. * [Core] The adapter now has an _Endpoint_ definition as string containing remote IP and port.
* [Client] Received messages are now processed completely in the worker thread without creating new Tasks. * [Client] Received messages are now processed completely in the worker thread without creating new Tasks.
* [Client] Fixed wrong calculation for sending keep alive packets (thanks to @cstichlberger) * [Client] Fixed wrong calculation for sending keep alive packets (thanks to @cstichlberger)
* [Client] A clean disconnect (via DisconnectAsync) will no longer throw an exception.
* [ManagedClient] The managed client is moved to a separate nuget package.
* [ManagedClient] Added an own message format with extended properties like ID.
* [ManagedClient] Fixed a loading issue of stored application messages (thanks to @JTrotta). * [ManagedClient] Fixed a loading issue of stored application messages (thanks to @JTrotta).
* [Server] Added support for other WebSocket sub protocol formats like mqttv-3.1.1 (thanks to @israellot). * [Server] Added support for other WebSocket sub protocol formats like mqttv-3.1.1 (thanks to @israellot).
* [Server] The takeover of an existing client sessions is now treated as a _clean_ disconnect of the previous client. * [Server] The takeover of an existing client sessions is now treated as a _clean_ disconnect of the previous client.


+ 9
- 1
Build/build.ps1 View File

@@ -26,10 +26,18 @@ if ($path) {
&$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx" &$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx" &$msbuild ..\Extensions\MQTTnet.Extensions.Rpc\MQTTnet.Extensions.Rpc.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"


Remove-Item .\NuGet -Force -Recurse -ErrorAction SilentlyContinue
# Build the Managed Client extension
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net452" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net461" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard1.3" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Extensions\MQTTnet.Extensions.ManagedClient\MQTTnet.Extensions.ManagedClient.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"

Remove-Item .\NuGet -Force -Recurse -ErrorAction SilentlyContinue


New-Item -ItemType Directory -Force -Path .\NuGet New-Item -ItemType Directory -Force -Path .\NuGet
.\NuGet.exe pack MQTTnet.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion .\NuGet.exe pack MQTTnet.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.AspNetCore.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion .\NuGet.exe pack MQTTnet.AspNetCore.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.Extensions.Rpc.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion .\NuGet.exe pack MQTTnet.Extensions.Rpc.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
.\NuGet.exe pack MQTTnet.Extensions.ManagedClient.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $nugetVersion
} }

Frameworks/MQTTnet.NetStandard/ManagedClient/ApplicationMessageProcessedEventArgs.cs → Extensions/MQTTnet.Extensions.ManagedClient/ApplicationMessageProcessedEventArgs.cs View File

@@ -1,6 +1,6 @@
using System; using System;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public class ApplicationMessageProcessedEventArgs : EventArgs public class ApplicationMessageProcessedEventArgs : EventArgs
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClient.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using MQTTnet.Client; using MQTTnet.Client;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public interface IManagedMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable public interface IManagedMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClientOptions.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientOptions.cs View File

@@ -1,7 +1,7 @@
using System; using System;
using MQTTnet.Client; using MQTTnet.Client;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public interface IManagedMqttClientOptions public interface IManagedMqttClientOptions
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/IManagedMqttClientStorage.cs → Extensions/MQTTnet.Extensions.ManagedClient/IManagedMqttClientStorage.cs View File

@@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public interface IManagedMqttClientStorage public interface IManagedMqttClientStorage
{ {

+ 31
- 0
Extensions/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj View File

@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;net452;net461;uap10.0</TargetFrameworks>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
<Product />
<Company />
<Authors />
<PackageId />
<Version>0.0.0.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NugetTargetMoniker>UAP,Version=v10.0</NugetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.17134.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>
<ProjectReference Include="..\..\Frameworks\MQTTnet.NetStandard\MQTTnet.NetStandard.csproj" />
</ItemGroup>

</Project>

+ 11
- 0
Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs View File

@@ -0,0 +1,11 @@
using System;

namespace MQTTnet.Extensions.ManagedClient
{
public class ManagedMqttApplicationMessage
{
public Guid Id { get; set; } = Guid.NewGuid();

public MqttApplicationMessage ApplicationMessage { get; set; }
}
}

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClient.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs View File

@@ -10,7 +10,7 @@ using MQTTnet.Exceptions;
using MQTTnet.Internal; using MQTTnet.Internal;
using MQTTnet.Protocol; using MQTTnet.Protocol;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public class ManagedMqttClient : IManagedMqttClient public class ManagedMqttClient : IManagedMqttClient
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientExtensions.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientExtensions.cs View File

@@ -2,7 +2,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using MQTTnet.Protocol; using MQTTnet.Protocol;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public static class ManagedMqttClientExtensions public static class ManagedMqttClientExtensions
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientOptions.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptions.cs View File

@@ -1,7 +1,7 @@
using System; using System;
using MQTTnet.Client; using MQTTnet.Client;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public class ManagedMqttClientOptions : IManagedMqttClientOptions public class ManagedMqttClientOptions : IManagedMqttClientOptions
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientOptionsBuilder.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientOptionsBuilder.cs View File

@@ -1,7 +1,7 @@
using System; using System;
using MQTTnet.Client; using MQTTnet.Client;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public class ManagedMqttClientOptionsBuilder public class ManagedMqttClientOptionsBuilder
{ {

Frameworks/MQTTnet.NetStandard/ManagedClient/ManagedMqttClientStorageManager.cs → Extensions/MQTTnet.Extensions.ManagedClient/ManagedMqttClientStorageManager.cs View File

@@ -4,7 +4,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MQTTnet.Internal; using MQTTnet.Internal;


namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public class ManagedMqttClientStorageManager public class ManagedMqttClientStorageManager
{ {

+ 24
- 0
Extensions/MQTTnet.Extensions.ManagedClient/MqttFactoryExtensions.cs View File

@@ -0,0 +1,24 @@
using System;
using MQTTnet.Client;
using MQTTnet.Diagnostics;

namespace MQTTnet.Extensions.ManagedClient
{
public static class MqttFactoryExtensions
{
public static IManagedMqttClient CreateManagedMqttClient(this IMqttClientFactory factory)
{
if (factory == null) throw new ArgumentNullException(nameof(factory));

return new ManagedMqttClient(factory.CreateMqttClient(), new MqttNetLogger().CreateChildLogger());
}

public static IManagedMqttClient CreateManagedMqttClient(this IMqttClientFactory factory, IMqttNetLogger logger)
{
if (factory == null) throw new ArgumentNullException(nameof(factory));
if (logger == null) throw new ArgumentNullException(nameof(logger));

return new ManagedMqttClient(factory.CreateMqttClient(), logger.CreateChildLogger());
}
}
}

Frameworks/MQTTnet.NetStandard/ManagedClient/ReconnectionResult.cs → Extensions/MQTTnet.Extensions.ManagedClient/ReconnectionResult.cs View File

@@ -1,4 +1,4 @@
namespace MQTTnet.ManagedClient
namespace MQTTnet.Extensions.ManagedClient
{ {
public enum ReconnectionResult public enum ReconnectionResult
{ {

+ 0
- 5
Frameworks/MQTTnet.NetStandard/Client/IMqttClientFactory.cs View File

@@ -1,5 +1,4 @@
using MQTTnet.Diagnostics; using MQTTnet.Diagnostics;
using MQTTnet.ManagedClient;


namespace MQTTnet.Client namespace MQTTnet.Client
{ {
@@ -8,9 +7,5 @@ namespace MQTTnet.Client
IMqttClient CreateMqttClient(); IMqttClient CreateMqttClient();


IMqttClient CreateMqttClient(IMqttNetLogger logger); IMqttClient CreateMqttClient(IMqttNetLogger logger);
IManagedMqttClient CreateManagedMqttClient();

IManagedMqttClient CreateManagedMqttClient(IMqttNetLogger logger);
} }
} }

Loading…
Cancel
Save