Fix running state handling in server (#1680)

Fix running state handling
This commit is contained in:
Christian
2023-02-17 21:17:31 +01:00
committed by GitHub
parent 6dcb110737
commit ba57537108
2 changed files with 3 additions and 3 deletions
+2 -3
View File
@@ -94,10 +94,9 @@ namespace MQTTnet.Server
try
{
var cancellationToken = _cancellationToken.Token;
_ = Task.Factory.StartNew(() => SendPacketsLoop(cancellationToken), cancellationToken, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false);
IsRunning = true;
_ = Task.Factory.StartNew(() => SendPacketsLoop(cancellationToken), cancellationToken, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false);
await ReceivePackagesLoop(cancellationToken).ConfigureAwait(false);
}