Improve performance.

This commit is contained in:
Christian Kratky
2020-11-13 20:33:47 +01:00
parent cc405c3e90
commit d0a848c8b4
18 changed files with 201 additions and 171 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ namespace MQTTnet.Tests
var @lock = new AsyncLock();
for (var i = 0; i < 100; i++)
{
using (await @lock.WaitAsync().ConfigureAwait(false))
using (await @lock.WaitAsync(CancellationToken.None).ConfigureAwait(false))
{
sum++;
}
@@ -33,7 +33,7 @@ namespace MQTTnet.Tests
var @lock = new AsyncLock();
// This call will never "release" the lock due to missing _using_.
await @lock.WaitAsync().ConfigureAwait(false);
await @lock.WaitAsync(CancellationToken.None).ConfigureAwait(false);
using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)))
{
@@ -21,4 +21,10 @@
<ProjectReference Include="..\..\Source\MQTTnet\MQTTnet.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Start.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
@@ -67,8 +67,7 @@ namespace MQTTnet.TestApp.NetCore
{
Server = "127.0.0.1"
},
CleanSession = true,
//KeepAlivePeriod = TimeSpan.FromSeconds(1)
CleanSession = true
};
var client = new MqttFactory().CreateMqttClient();
+1
View File
@@ -0,0 +1 @@
dotnet MQTTnet.TestApp.NetCore.dll