You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
463 B

  1. using System;
  2. using MQTTnet.Core.Adapter;
  3. using MQTTnet.Core.Server;
  4. namespace MQTTnet
  5. {
  6. public class MqttServerFactory
  7. {
  8. public MqttServer CreateMqttServer(MqttServerOptions options)
  9. {
  10. if (options == null) throw new ArgumentNullException(nameof(options));
  11. return new MqttServer(options, options.UseSSL ? (IMqttServerAdapter)new MqttSslServerAdapter() : new MqttServerAdapter());
  12. }
  13. }
  14. }