Add autoreconnect to network clients#433
Merged
Merged
Conversation
Contributor
|
Consider that even if the network drops, when it is available again, the communication should restart without issues, provided that the sockets did not close. This is useful in case the server is restarted. Nonetheless, I would avoid doing this connections automatically. I would suggest to use a RPC instead. The reasons are:
Hence, if the reconnection is done "manually", you can avoid both issues. Another possibility would be to enable this mechanism only via optional configuration parameter |
traversaro
approved these changes
Jun 4, 2026
Contributor
traversaro
left a comment
There was a problem hiding this comment.
Ok for me once @S-Dafarra is happy.
Contributor
Author
|
@S-Dafarra I switched to using yarp's |
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 adds automatic reconnection logic for their input ports if the connection to the expected data source is lost.
This allows e.g. the HumanStateVisualizer to keep running while the other modules restart
Key changes include:
Automatic reconnection and port monitoring:
HumanDynamics_nwc_yarp,HumanState_nwc_yarp,HumanWrench_nwc_yarp,WearableTargets_nwc_yarp) now checks in itsrun()method whether its input port is disconnected. If so, it logs a warning (throttled to once every 5 seconds) and attempts to reconnect to the configured data port. This makes the clients more resilient to temporary network issues.cc @camillagallina2000