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

MqttClientFactory.cs 414 B

12345678910111213141516
  1. using System;
  2. using MQTTnet.Core.Client;
  3. using MQTTnet.Implementations;
  4. namespace MQTTnet
  5. {
  6. public class MqttClientFactory : IMqttClientFactory
  7. {
  8. public IMqttClient CreateMqttClient(MqttClientOptions options)
  9. {
  10. if (options == null) throw new ArgumentNullException(nameof(options));
  11. return new MqttClient(new MqttCommunicationAdapterFactory());
  12. }
  13. }
  14. }