mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-23 22:04:43 +08:00
Fix UnitTests
This commit is contained in:
@@ -156,7 +156,7 @@ namespace MQTTnet.Core.Tests
|
|||||||
var message = new MqttApplicationMessageBuilder().WithTopic("a").WithAtLeastOnceQoS().Build();
|
var message = new MqttApplicationMessageBuilder().WithTopic("a").WithAtLeastOnceQoS().Build();
|
||||||
await c1.SubscribeAsync(new TopicFilter("a", MqttQualityOfServiceLevel.AtLeastOnce));
|
await c1.SubscribeAsync(new TopicFilter("a", MqttQualityOfServiceLevel.AtLeastOnce));
|
||||||
|
|
||||||
s.PublishAsync(message).Wait();
|
await s.PublishAsync(message);
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -47,7 +47,17 @@ namespace MQTTnet.Core.Tests
|
|||||||
{
|
{
|
||||||
ThrowIfPartnerIsNull();
|
ThrowIfPartnerIsNull();
|
||||||
|
|
||||||
return Task.Run(() => _incomingPackets.Take(), cancellationToken);
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _incomingPackets.Take(cancellationToken);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnqueuePacketInternal(MqttBasePacket packet)
|
private void EnqueuePacketInternal(MqttBasePacket packet)
|
||||||
|
|||||||
Reference in New Issue
Block a user