mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
Merge pull request #66 from JTrotta/develop
Add support to not persistent Queue
This commit is contained in:
@@ -7,7 +7,7 @@ namespace MQTTnet.Implementations
|
||||
{
|
||||
public class MqttCommunicationAdapterFactory : IMqttCommunicationAdapterFactory
|
||||
{
|
||||
public IMqttCommunicationAdapter CreateMqttCommunicationAdapter(MqttClientOptions options)
|
||||
public IMqttCommunicationAdapter CreateMqttCommunicationAdapter(IMqttClientOptions options)
|
||||
{
|
||||
if (options == null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
@@ -21,6 +21,11 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace MQTTnet.Implementations
|
||||
return _options.TlsOptions.AllowUntrustedCertificates;
|
||||
}
|
||||
|
||||
private static X509CertificateCollection LoadCertificates(MqttClientOptions options)
|
||||
private static X509CertificateCollection LoadCertificates(IMqttClientOptions options)
|
||||
{
|
||||
var certificates = new X509CertificateCollection();
|
||||
if (options.TlsOptions.Certificates == null)
|
||||
|
||||
Reference in New Issue
Block a user