Files
MQTTnet/Frameworks/MQTTnet.NetCoreApp/MqttServerFactory.cs
T
Zazzmatazz 2db289a658 Added TLS1.2 support to client and server.
Added MqttClientSslChannel and MqttServerSslChannel which both utilize
an SSL stream.  Added options to both MqttCLientOptions and
MqttServerOptions.  I was unable to update the code in
MQTTnet.UniversalWindows due to my lack of Windows 10.
2017-06-02 09:19:47 -04:00

18 lines
524 B
C#

using System;
using MQTTnet.Core.Adapter;
using MQTTnet.Core.Server;
namespace MQTTnet
{
public class MqttServerFactory
{
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());
}
}
}