Merge pull request #66 from JTrotta/develop

Add support to not persistent Queue
This commit is contained in:
Christian
2017-10-19 18:49:55 +02:00
committed by GitHub
23 changed files with 549 additions and 43 deletions
@@ -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)