mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
17 lines
464 B
C#
17 lines
464 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));
|
|
|
|
return new MqttServer(options, options.UseSSL ? (IMqttServerAdapter) new MqttSslServerAdapter() : new MqttServerAdapter());
|
|
}
|
|
}
|
|
}
|