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.

MqttClientFactory.cs 489 B

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