mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-11-02 12:12:38 +08:00
Merge branch 'Fix-high-CPU-usage'
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
* [ManagedClient] The managed client now sends the entire topic filter including new MQTTv5 properties when subscribing.
|
* [ManagedClient] The managed client now sends the entire topic filter including new MQTTv5 properties when subscribing.
|
||||||
* [Server] Fixed reporting of _MaximumQoS_ in _ConnAck_ packet (MQTTv5 only) (#1442).
|
* [Server] Fixed reporting of _MaximumQoS_ in _ConnAck_ packet (MQTTv5 only) (#1442).
|
||||||
* [Server] Fix cross thread issue in session message storage for QoS 1 and 2.
|
* [Server] Fix cross thread issue in session message storage for QoS 1 and 2.
|
||||||
* [Server] The event _ClientSubscribedTopicAsync_ is now fired after the subscription is completely processed internally (#1435).
|
* [Server] The event _ClientSubscribedTopicAsync_ is now fired after the subscription is completely processed internally (#1435).
|
||||||
|
* [Server] Improved CPU usage on lower end machines (#788).
|
||||||
@@ -188,6 +188,8 @@ namespace MQTTnet.Server
|
|||||||
// own exception in the reading loop!
|
// own exception in the reading loop!
|
||||||
while (!cancellationToken.IsCancellationRequested)
|
while (!cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
await Task.Yield();
|
||||||
|
|
||||||
var packet = await ChannelAdapter.ReceivePacketAsync(cancellationToken).ConfigureAwait(false);
|
var packet = await ChannelAdapter.ReceivePacketAsync(cancellationToken).ConfigureAwait(false);
|
||||||
if (packet == null)
|
if (packet == null)
|
||||||
{
|
{
|
||||||
@@ -315,6 +317,10 @@ namespace MQTTnet.Server
|
|||||||
{
|
{
|
||||||
packetBusItem.MarkAsFailed(exception);
|
packetBusItem.MarkAsFailed(exception);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
await Task.Yield();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
|
|||||||
Reference in New Issue
Block a user