diff --git a/Frameworks/MQTTnet.NetCoreApp/MqttClientFactory.cs b/Frameworks/MQTTnet.NetCoreApp/MqttClientFactory.cs index 62b6569..10ff3fa 100644 --- a/Frameworks/MQTTnet.NetCoreApp/MqttClientFactory.cs +++ b/Frameworks/MQTTnet.NetCoreApp/MqttClientFactory.cs @@ -13,8 +13,6 @@ namespace MQTTnet if (options == null) throw new ArgumentNullException(nameof(options)); return new MqttClient(options, - // The cast to IMqttCommunicationChannel is required... Roslyn is too stupid to - // figure out how to cast back to the base type new MqttChannelCommunicationAdapter(options.UseSSL ? new MqttClientSslChannel() : (IMqttCommunicationChannel) new MqttTcpChannel(), new DefaultMqttV311PacketSerializer())); } diff --git a/Frameworks/MQTTnet.NetCoreApp/MqttServerFactory.cs b/Frameworks/MQTTnet.NetCoreApp/MqttServerFactory.cs index 5098ea2..bc5ef2f 100644 --- a/Frameworks/MQTTnet.NetCoreApp/MqttServerFactory.cs +++ b/Frameworks/MQTTnet.NetCoreApp/MqttServerFactory.cs @@ -9,8 +9,7 @@ namespace MQTTnet public MqttServer CreateMqttServer(MqttServerOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); - - // The cast to IMqttServerAdapter is required... stupidly... + return new MqttServer(options, options.UseSSL ? (IMqttServerAdapter)new MqttSslServerAdapter() : new MqttServerAdapter()); } } diff --git a/Frameworks/MQTTnet.NetFramework/MqttServerFactory.cs b/Frameworks/MQTTnet.NetFramework/MqttServerFactory.cs index a26fbdb..71e57af 100644 --- a/Frameworks/MQTTnet.NetFramework/MqttServerFactory.cs +++ b/Frameworks/MQTTnet.NetFramework/MqttServerFactory.cs @@ -10,7 +10,6 @@ namespace MQTTnet { if (options == null) throw new ArgumentNullException(nameof(options)); - // The cast to IMqttServerAdapter is required... stupidly... return new MqttServer(options, options.UseSSL ? (IMqttServerAdapter) new MqttSslServerAdapter() : new MqttServerAdapter()); } }