mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +08:00
Refactor managed MQTT client
This commit is contained in:
@@ -21,11 +21,6 @@ namespace MQTTnet.Implementations
|
||||
return new MqttChannelCommunicationAdapter(new MqttWebSocketChannel(webSocketOptions), new MqttPacketSerializer { ProtocolVersion = options.ProtocolVersion });
|
||||
}
|
||||
|
||||
if (options is MqttClientManagedOptions queuedOptions)
|
||||
{
|
||||
return new MqttChannelCommunicationAdapter(new MqttTcpChannel(queuedOptions), new MqttPacketSerializer { ProtocolVersion = options.ProtocolVersion });
|
||||
}
|
||||
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MQTTnet.Core.Client;
|
||||
using MQTTnet.Core.ManagedClient;
|
||||
using MQTTnet.Implementations;
|
||||
|
||||
namespace MQTTnet
|
||||
@@ -10,9 +11,9 @@ namespace MQTTnet
|
||||
return new MqttClient(new MqttCommunicationAdapterFactory());
|
||||
}
|
||||
|
||||
public IMqttClientManaged CreateMqttManagedClient()
|
||||
public ManagedMqttClient CreateManagedMqttClient()
|
||||
{
|
||||
return new MqttClientManaged(new MqttCommunicationAdapterFactory());
|
||||
return new ManagedMqttClient(new MqttCommunicationAdapterFactory());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,12 +21,6 @@ namespace MQTTnet.Implementations
|
||||
return new MqttChannelCommunicationAdapter(new MqttWebSocketChannel(webSocketOptions), new MqttPacketSerializer { ProtocolVersion = options.ProtocolVersion });
|
||||
}
|
||||
|
||||
if (options is MqttClientManagedOptions queuedOptions)
|
||||
{
|
||||
return new MqttChannelCommunicationAdapter(new MqttTcpChannel(queuedOptions), new MqttPacketSerializer { ProtocolVersion = options.ProtocolVersion });
|
||||
}
|
||||
|
||||
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MQTTnet.Core.Client;
|
||||
using MQTTnet.Core.ManagedClient;
|
||||
using MQTTnet.Implementations;
|
||||
|
||||
namespace MQTTnet
|
||||
@@ -10,9 +11,9 @@ namespace MQTTnet
|
||||
return new MqttClient(new MqttCommunicationAdapterFactory());
|
||||
}
|
||||
|
||||
public IMqttClientManaged CreateMqttManagedClient()
|
||||
public ManagedMqttClient CreateManagedMqttClient()
|
||||
{
|
||||
return new MqttClientManaged(new MqttCommunicationAdapterFactory());
|
||||
return new ManagedMqttClient(new MqttCommunicationAdapterFactory());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user