-
Notifications
You must be signed in to change notification settings - Fork 46
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
Sending and receiving on the same port #40
Comments
It is because the maintainer does not use the library himself, and there was no unit test to use that constructor, for example one to test sending and receiving on the same port, because the maintainer did not think about writing one. |
I just saw, that |
That sounds reasonable to me, but I think we might need to support the use case where you only need to send or you only need to receive. In other words, if I initialize an OSCPort and use it to send messages (and I don't plan to receive messages), I don't want to inadvertently be affected by any messages that might be sent to the same port for whatever reason. I'm not sure, per se, if there would be any issues like that, but it's worth considering. |
Ahh yeah... |
@hoijui, can you give an update on the status of this issue? I can't get my integration on the Behringer X32 to work: I send a message, and see in Wireshark that the server responds back over UDP, but there's no way for me to get the message. |
@astellingwerf I don't know how correct it will be to write it here but I want to share my own implementation used in my personal project: overstream-osc. This is a module that used to communicate with my X32 mixing console. It has two implementations for NIO (with no dependencies) and Netty. Honestly there is one big problem: tighter integration with the local fameless app framework, which currently is unlikely to be useful to someone. |
@astellingwerf @Show-vars |
@astellingwerf, realistically, I am not going to have time for this any time soon |
I'm also interested in this, did we agree about any solution yet? I could help with some code maybe. |
What about an additional class OSCPortInOut that combines the functionality of OSCPortIn and OSCPortOut |
One more thing, while I also have trouble receiving data from X32 Behringer (which sends data on the same port you send data to it), I can control Reaper bidirectionally using the same port for input and output. |
Ok, I think we can close this issue. Taking the same port for incoming and outgoing messages works. To make X32 work, you have to create the Output port with the local socket you want to receive messages to. |
Ok, one more thing. Having an OscPortIn and OscPortOut with same same port number seems to be OS dependent, if it works or not. |
I do not understand why the maintainer removed the ability to use one local port for receiving and sending simultaneously. This problem has already occurred before (#5 and #17) but after big code updates this problem appeared again. This imposes big restrictions on the using of this library.
The main problem is a splitting
OSCPort
into two independent classesOSCPortIn
andOSCPortOut
that uses different instances ofDatagramChannel
. Using socket optionSO_REUSEADDR
seems not to solve this issue.Originally I was trying to write a small app that communicates with my Behringer X32 mixer. That one always send response to the same port from which requests are sent.
I had to completely rewrite these main classes. Actually, I could open the pull request but since my changes greatly affect the core of the library, I decided to limit only with new issue.
The text was updated successfully, but these errors were encountered: