Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python NetSync client to better support multi-NIC environments by (a) selecting the correct local source IP for outbound ZeroMQ connections and (b) broadcasting/listening for UDP discovery across multiple NIC-bound sockets.
Changes:
- Add source-NIC auto-detection and build ZeroMQ “extended TCP” connect addresses when a non-local destination is used.
- Refactor UDP discovery to create one socket per local interface and broadcast discovery messages on each.
- Add directed broadcast address calculation (per local IP) for improved discovery reachability.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rove battery drain rate formatting in client simulator
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 reliability and flexibility of network connection and discovery in both the Python server (
styly_netsync/client.py) and Unity client (ConnectionManager.cs,ServerDiscoveryManager.cs). The main improvements are: (1) robust support for multi-NIC (multiple network interface cards) environments, ensuring correct NIC selection for outgoing connections and UDP broadcasts; (2) improved UDP discovery logic to broadcast and listen on all available interfaces; and (3) better error handling and logging for network operations. These changes make the system more resilient and discoverable in complex network setups.Network interface selection and connection improvements:
tcp://source_ip:0;dest_host:port) when appropriate, ensuring traffic uses the right interface. [1] [2] [3]UDP discovery enhancements:
Error handling and logging:
Code organization and maintainability:
These improvements collectively make the NetSync system more robust in real-world, multi-network environments, and easier to maintain and debug.
Close #359