25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
510 B

  1. using System;
  2. using MQTTnet.Core.Adapter;
  3. using MQTTnet.Core.Client;
  4. using MQTTnet.Core.Serializer;
  5. using MQTTnet.Implementations;
  6. namespace MQTTnet
  7. {
  8. public class MqttClientFactory
  9. {
  10. public IMqttClient CreateMqttClient(MqttClientOptions options)
  11. {
  12. if (options == null) throw new ArgumentNullException(nameof(options));
  13. return new MqttClient(options, new MqttChannelCommunicationAdapter(new MqttTcpChannel(), new MqttPacketSerializer()));
  14. }
  15. }
  16. }