您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MqttServerFactory.cs 483 B

123456789101112131415161718
  1. using System;
  2. using System.Collections.Generic;
  3. using MQTTnet.Core.Adapter;
  4. using MQTTnet.Core.Server;
  5. using MQTTnet.Implementations;
  6. namespace MQTTnet
  7. {
  8. public class MqttServerFactory
  9. {
  10. public MqttServer CreateMqttServer(MqttServerOptions options)
  11. {
  12. if (options == null) throw new ArgumentNullException(nameof(options));
  13. return new MqttServer(options, new List<IMqttServerAdapter> { new MqttServerAdapter() });
  14. }
  15. }
  16. }