-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unnecessary Port Binding for ArtNet Sender #26
Comments
tylerstraub
added a commit
to tylerstraub/artnet4j
that referenced
this issue
May 31, 2024
Modify the artnet4j library to avoid static binding its port when acting solely as a Sender. Instead, it should use an ephemeral port for sending data.
tylerstraub
added a commit
to tylerstraub/artnet4j
that referenced
this issue
May 31, 2024
Modify the artnet4j library to avoid static binding its port when acting solely as a Sender. Instead, it should use an ephemeral port for sending data.
PR sent: #27 This branch implements a boolean option to I'm not sure if this fix is necessarily ideal for main branch but it exists now for anyone out there struggling with this same problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the artnet4j library in a Processing 4 application, the library creates a UDP port binding even when acting as an ArtNet Sender. This behavior leads to binding conflicts with other applications that may need to communicate locally, such as DigiShow LINK and QLC+, which do not bind to a specific port when sending ArtNet data.
Expected Behavior
ArtNet Sender applications should use an ephemeral port for sending data and should not bind to a specific port (e.g. 6454). Only ArtNet Receiver applications require a static bind to listen for incoming ArtNet packets.
Observed Behavior
The artnet4j library binds a port regardless of whether it is used as a Sender or Receiver. This causes conflicts when other applications attempt to bind to the same port.
Steps to Reproduce
Condition 1: Sender = Processing 4, Receiver = DigiShow LINK
Condition 2: Receiver = Processing 4, Sender = DigiShow LINK
Extra Tests:
Diagnostic Results
Using
lsof
on macOS reveals that DigiShow LINK does not create a binding when sending ArtNet, but the Processing 4 application using artnet4j does:DigiShow LINK as Sender (no binding):
Output: (empty)
Processing 4 as Sender (binding occurs):
sudo lsof -i :6454 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 27353 tylerstraub 21u IPv6 0xe877803c50f1714e 0t0 UDP *:6454
Validation of Ephemeral Port Usage in DigiShow LINK
After examining the DigiShow LINK source code, it was confirmed that DigiShow LINK uses ephemeral ports for sending ArtNet data. This approach prevents port conflicts and allows the application to coexist with other applications that need to bind as a Reciever.
Key Points from
dgs_artnet_interface.cpp
:UDP Port Definition:
UDP Socket Initialization:
m_udp = new QUdpSocket();
Binding the UDP Socket for Input:
Setting Up the UDP Socket for Output:
Suggested Fix
Modify the artnet4j library to avoid static binding its port when acting solely as a Sender. Instead, it should use an ephemeral port for sending data.
Proposed Code Changes
Here is an example modification to the
ArtNetServer
class:In the application code, specify whether the instance is acting as a Sender or Receiver:
Conclusion
By implementing these changes, the artnet4j library will avoid unnecessary port bindings when acting as a Sender, preventing conflicts with other applications and allowing for more flexible execution order.
The text was updated successfully, but these errors were encountered: