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

20 行
662 B

  1. using MQTTnet.Core.Client;
  2. using MQTTnet.Core.Diagnostics;
  3. using MQTTnet.Core.ManagedClient;
  4. using MQTTnet.Implementations;
  5. namespace MQTTnet
  6. {
  7. public class MqttClientFactory : IMqttClientFactory
  8. {
  9. public IMqttClient CreateMqttClient(IMqttNetTraceHandler traceHandler = null)
  10. {
  11. return new MqttClient(new MqttCommunicationAdapterFactory(), new MqttNetTrace(traceHandler));
  12. }
  13. public ManagedMqttClient CreateManagedMqttClient(IMqttNetTraceHandler traceHandler = null)
  14. {
  15. return new ManagedMqttClient(new MqttCommunicationAdapterFactory(), new MqttNetTrace(traceHandler));
  16. }
  17. }
  18. }