diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec index 2f0b809..1a7661f 100644 --- a/Build/MQTTnet.nuspec +++ b/Build/MQTTnet.nuspec @@ -2,7 +2,7 @@ MQTTnet - 2.7.3 + 2.7.4 Christian Kratky Christian Kratky https://github.com/chkr1011/MQTTnet/blob/master/LICENSE @@ -10,14 +10,9 @@ https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png false MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). - * [Core] Add several new extension methods. -* [Client] Fixed an issue in _ManagedMqttClientOptionsBuilder_ when using _WithClientOptions_ and an options builder. -* [Client] Added the "IsStarted" property for the managed client. -* [Client] Optimized stream buffer for UWP apps. -* [Client] Added the _BufferSize_ to the TCP options. -* [Client] Fixed a race condition which leads to exceptions when reconnecting rapidly. -* [Server] Fixed a race condition which leads to exceptions when clients are reconnecting rapidly. -* [Core] Fixed some issues in stream and socket handling. + +* [Server] The _MqttTcpServerAdapter_ is now added to the ASP.NET services. +* [Server] _MqttServerAdapter_ is renamed to _MqttTcpServerAdapter_ (BREAKING CHANGE!). Copyright Christian Kratky 2016-2018 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 @@ -46,6 +41,12 @@ + + + + + + @@ -64,6 +65,8 @@ + + \ No newline at end of file diff --git a/Frameworks/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs b/Frameworks/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs index df87af7..61354cd 100644 --- a/Frameworks/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs +++ b/Frameworks/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs @@ -21,9 +21,9 @@ namespace MQTTnet.AspNetCore services.AddSingleton(s => s.GetService()); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(s => s.GetService()); - services.AddSingleton(s => s.GetService()); + services.AddSingleton(s => s.GetService()); return services; } diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.Uwp.cs b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.Uwp.cs similarity index 90% rename from Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.Uwp.cs rename to Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.Uwp.cs index 96fbae4..e71d6ff 100644 --- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.Uwp.cs +++ b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.Uwp.cs @@ -9,12 +9,12 @@ using MQTTnet.Server; namespace MQTTnet.Implementations { - public class MqttServerAdapter : IMqttServerAdapter, IDisposable + public class MqttTcpServerAdapter : IMqttServerAdapter, IDisposable { private readonly IMqttNetLogger _logger; private StreamSocketListener _defaultEndpointSocket; - public MqttServerAdapter(IMqttNetLogger logger) + public MqttTcpServerAdapter(IMqttNetLogger logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } @@ -67,7 +67,7 @@ namespace MQTTnet.Implementations } catch (Exception exception) { - _logger.Error(exception, "Error while accepting connection at default endpoint."); + _logger.Error(exception, "Error while accepting connection at default endpoint."); } } } diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.cs similarity index 94% rename from Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs rename to Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.cs index 0d0429d..dc33a3f 100644 --- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs +++ b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpServerAdapter.cs @@ -14,7 +14,7 @@ using MQTTnet.Server; namespace MQTTnet.Implementations { - public class MqttServerAdapter : IMqttServerAdapter, IDisposable + public class MqttTcpServerAdapter : IMqttServerAdapter, IDisposable { private readonly IMqttNetLogger _logger; @@ -23,7 +23,7 @@ namespace MQTTnet.Implementations private Socket _tlsEndpointSocket; private X509Certificate2 _tlsCertificate; - public MqttServerAdapter(IMqttNetLogger logger) + public MqttTcpServerAdapter(IMqttNetLogger logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } @@ -117,7 +117,7 @@ namespace MQTTnet.Implementations return; } - _logger.Error(exception, "Error while accepting connection at default endpoint."); + _logger.Error(exception, "Error while accepting connection at default endpoint."); await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false); } } @@ -152,7 +152,7 @@ namespace MQTTnet.Implementations return; } - _logger.Error(exception, "Error while accepting connection at TLS endpoint."); + _logger.Error(exception, "Error while accepting connection at TLS endpoint."); await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false); } } diff --git a/Frameworks/MQTTnet.NetStandard/MqttFactory.cs b/Frameworks/MQTTnet.NetStandard/MqttFactory.cs index 5b0174b..e3b3549 100644 --- a/Frameworks/MQTTnet.NetStandard/MqttFactory.cs +++ b/Frameworks/MQTTnet.NetStandard/MqttFactory.cs @@ -38,7 +38,14 @@ namespace MQTTnet public IMqttServer CreateMqttServer() { var logger = new MqttNetLogger(); - return CreateMqttServer(new List { new MqttServerAdapter(logger) }, logger); + return CreateMqttServer(logger); + } + + public IMqttServer CreateMqttServer(IMqttNetLogger logger) + { + if (logger == null) throw new ArgumentNullException(nameof(logger)); + + return CreateMqttServer(new List { new MqttTcpServerAdapter(logger) }, logger); } public IMqttServer CreateMqttServer(IEnumerable adapters, IMqttNetLogger logger)