Przeglądaj źródła

Start a dedicated thread per client.

release/3.x.x
Christian 6 lat temu
rodzic
commit
febc8f774d
2 zmienionych plików z 6 dodań i 4 usunięć
  1. +4
    -2
      Frameworks/MQTTnet.NetStandard/Server/MqttServer.cs
  2. +2
    -2
      Frameworks/MQTTnet.Netstandard/MQTTnet.NetStandard.csproj

+ 4
- 2
Frameworks/MQTTnet.NetStandard/Server/MqttServer.cs Wyświetl plik

@@ -156,9 +156,11 @@ namespace MQTTnet.Server

private void OnClientAccepted(object sender, MqttServerAdapterClientAcceptedEventArgs eventArgs)
{
eventArgs.SessionTask = Task.Run(
eventArgs.SessionTask = Task.Factory.StartNew(
() => _clientSessionsManager.RunSessionAsync(eventArgs.Client, _cancellationTokenSource.Token),
_cancellationTokenSource.Token);
_cancellationTokenSource.Token,
TaskCreationOptions.LongRunning,
TaskScheduler.Current);
}
}
}

+ 2
- 2
Frameworks/MQTTnet.Netstandard/MQTTnet.NetStandard.csproj Wyświetl plik

@@ -22,7 +22,7 @@
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NugetTargetMoniker>UAP,Version=v10.0</NugetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
@@ -56,7 +56,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='uap10.0'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.8" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net452'">


Ładowanie…
Anuluj
Zapisz