fix: adds ethernet event handler to GenericTcpClient to connect on li…#196
Merged
ndorin merged 2 commits intomaintenance-1xfrom Dec 12, 2025
Merged
fix: adds ethernet event handler to GenericTcpClient to connect on li…#196ndorin merged 2 commits intomaintenance-1xfrom
ndorin merged 2 commits intomaintenance-1xfrom
Conversation
ndorin
approved these changes
Dec 12, 2025
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.
This pull request enhances the robustness and reliability of the
GenericTcpIpClientclass by improving its handling of network connectivity events and connection management. The main focus is on ensuring automatic reconnection when the network link is restored, improving debug logging, and refining connection retry logic.Network event handling and reconnection:
CrestronEnvironment.EthernetEventHandlerin all constructors to handle Ethernet link events, allowing the client to attempt reconnection automatically when the network link comes back up. [1] [2] [3]CrestronEnvironment_EthernetEventHandlermethod, which listens forLinkUpevents and triggers a reconnect if the TCP client exists.Connection management improvements:
Connectmethod, added a debug message when creating a newTCPClientand ensured the retry timer is reset before attempting to connect.Client_SocketStatusChangemethod, now stops the retry timer when the socket status changes to a connected state, preventing unnecessary retries.Debugging and error handling:
ConnectToServerCallbackmethod by logging connection failures withDebug.LogError, making it easier to diagnose connection issues.