Skip to content

Commit

Permalink
Merge pull request #612 from WildernessLabs/set-persistent-connection…
Browse files Browse the repository at this point in the history
…s-on-mqtt-client

Set persistent connections on MQTT client side
  • Loading branch information
ctacke authored Feb 2, 2025
2 parents 6840f13 + 1945baf commit 8205327
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Meadow.Core/Cloud/MeadowCloudConnectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ private async void ConnectionStateMachine()
tlsParameters.UseTls = Settings.MqttPort == 8883;
})
.WithProtocolVersion(MQTTnet.Formatter.MqttProtocolVersion.V500)
.WithCleanSession(false)
.WithSessionExpiryInterval(86400) // Keep the session for 1 day
.WithCommunicationTimeout(TimeSpan.FromSeconds(30));

if (Settings.UseAuthentication)
Expand Down

0 comments on commit 8205327

Please sign in to comment.