-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting source address #24
base: master
Are you sure you want to change the base?
Conversation
Hey @hadleyrich, really good work, and thank you for making the PR It looks like I might need to upgrade the python version in CI to see the tests, meanwhile would you mind offering a small description of the feature either in code or in the readme? Can you also rebase master so that the test suite can run? |
WalkthroughThe change introduces a new Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- stupidArtnet/StupidArtnet.py (2 hunks)
Additional comments (Suppressed): 2
stupidArtnet/StupidArtnet.py (2)
22-23: The function signature of
__init__
has been changed to include a new parametersource_address
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, verify if the default value ofNone
forsource_address
is appropriate in all use cases.60-63: The socket option
SO_REUSEADDR
is set and the socket is bound to the source address if it is provided. This allows the client to use a specific network interface for sending Art-Net packets. However, be aware that settingSO_REUSEADDR
can potentially lead to some security risks as it allows multiple sockets on the same host to bind to the same IP address and port. Make sure you understand the implications of this change and consider whether it's necessary in your context.
I needed to set the source address to broadcast on a specific interface. This allowed me to do so, not sure if it's of use to anyone else but I thought I'd contribute in case you wanted it :)
Summary by CodeRabbit
source_address
in theStupidArtnet
class. This allows users to define a specific network interface for sending Art-Net packets, providing greater control over packet routing. The socket optionSO_REUSEADDR
is set when a source address is provided, enabling the reuse of socket addresses.