mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 11:45:43 +08:00
Fixed an TLS issue in the MqttClientOptionsBuilder; Fix a subscription issue in the managed client.
This commit is contained in:
@@ -15,6 +15,6 @@ namespace MQTTnet.Client
|
||||
Task DisconnectAsync();
|
||||
|
||||
Task<IList<MqttSubscribeResult>> SubscribeAsync(IEnumerable<TopicFilter> topicFilters);
|
||||
Task UnsubscribeAsync(IEnumerable<string> topicFilters);
|
||||
Task UnsubscribeAsync(IEnumerable<string> topics);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using MQTTnet.Protocol;
|
||||
|
||||
namespace MQTTnet.Client
|
||||
{
|
||||
public class MqttClient : IMqttClient
|
||||
public class MqttClient : IMqttClient, IDisposable
|
||||
{
|
||||
private readonly IMqttClientAdapterFactory _adapterFactory;
|
||||
private readonly MqttPacketDispatcher _packetDispatcher;
|
||||
@@ -180,6 +180,11 @@ namespace MQTTnet.Client
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_cancellationTokenSource?.Dispose();
|
||||
}
|
||||
|
||||
private async Task<MqttConnAckPacket> AuthenticateAsync(MqttApplicationMessage willApplicationMessage)
|
||||
{
|
||||
var connectPacket = new MqttConnectPacket
|
||||
|
||||
@@ -119,11 +119,11 @@ namespace MQTTnet.Client
|
||||
|
||||
if (_tcpOptions != null)
|
||||
{
|
||||
_options.ChannelOptions = _tcpOptions;
|
||||
_tcpOptions.TlsOptions = _tlsOptions;
|
||||
}
|
||||
else
|
||||
else if (_webSocketOptions != null)
|
||||
{
|
||||
_options.ChannelOptions = _webSocketOptions;
|
||||
_webSocketOptions.TlsOptions = _tlsOptions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user