mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-30 10:42:48 +08:00
Fix running state handling in server (#1680)
Fix running state handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user