[Backport release-4_1] Enable automatic reconnect for TCP and UDP NMEA receivers#7238
Merged
nirvn merged 1 commit intorelease-4_1from Mar 31, 2026
Merged
[Backport release-4_1] Enable automatic reconnect for TCP and UDP NMEA receivers#7238nirvn merged 1 commit intorelease-4_1from
nirvn merged 1 commit intorelease-4_1from
Conversation
The reconnect infrastructure (mReconnectOnDisconnect flag, mReconnectTimer with 2s delay, state change handler) exists in both TcpReceiver and UdpReceiver but is never activated. The flag mReconnectOnDisconnect is initialized to false and never set to true, so when a connection drops the reconnect timer never starts. This is inconsistent with BluetoothReceiver which correctly sets its equivalent flag (mConnectOnDisconnect = true) in handleConnectDevice() and tracks connection failures. Fix: set mReconnectOnDisconnect = true in handleConnectDevice() for both TCP and UDP receivers, with a failure counter that bails out after 10 failed reconnection attempts (matching BluetoothReceiver behavior). The flag is reset to false in handleDisconnectDevice() to prevent reconnection when the user explicitly disconnects.
Collaborator
Author
🪟 Windows buildsDownload a Windows build of this PR for testing. 🐧 Linux AppImage buildsDownload a Linux AppImage build of this PR for testing. 🍎 MacOS DMG universal buildsDownload a MacOS DMG universal build of this PR for testing. 📱 Android buildsDownload an Android arm64 build of this PR for testing. Other Android architectures |
nirvn
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #7228
Authored by: @MichaelEFlip