mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
18 lines
489 B
C#
18 lines
489 B
C#
using System;
|
|
using MQTTnet.Core.Adapter;
|
|
using MQTTnet.Core.Client;
|
|
using MQTTnet.Core.Serializer;
|
|
|
|
namespace MQTTnet
|
|
{
|
|
public class MqttClientFactory
|
|
{
|
|
public MqttClient CreateMqttClient(MqttClientOptions options)
|
|
{
|
|
if (options == null) throw new ArgumentNullException(nameof(options));
|
|
|
|
return new MqttClient(options, new MqttChannelCommunicationAdapter(new MqttTcpChannel(), new DefaultMqttV311PacketSerializer()));
|
|
}
|
|
}
|
|
}
|