So I have a handful of Juce VSTs.
In terms of the OSC code involved, one VST alone is “upstream”, the rest “downstream”.
I wish for the one upstream VST to be able to simultaneously broadcast my OSC stream to all recipients downstream.
I’ve tried by setting the OSCSender to port 255.255.255.255 - the observed behaviour seems to be that the first OSCReceiver object in the first downstream VST is able to connect successfully, then seemingly the port is locked and other OSCReceiver’s in the other VSTs cannot receive the messages - only the first one.
Is there something I’m missing? I poked around in the DatagramSocket class and noted that the default argument for the constructor suggests that broadcast capability is set to “true”. Does this not mean that internally it should be able to send to multiple recipients on the same port?
Note that the VSTs are all on the same localhost/127.0.0.1 internal network.
I’ve seen some information about sending to something like 192.168.0.255 or 192.168.1.255, but in this case, would it not route the packets to the router and broadcast from there? That’s not exactly what I want - simply to broadcast within localhost. Is this possible?
I assume you mean that you are sending it to the address 255.255.255.255 - there is no such thing as a broadcast port.
In any case, you need to find out your broadcast address. This is usually:
(ip & netmask) | (0xffffffff & ~netmask)
so something like 192.168.0.255 is more likely to be your broadcast address. On Mac/Linux: you can also find out your broadcast address by typing in
ifconfig into the terminal. The main network adapter is usually called
en0 on mac and you will see the broadcast address listed in that section.
By using this address you are not sending anything to the router - as this is your local address in your local network. Only when contacting ip addresses outside of your netmask do routers get contacted. Maybe you should read-up on the way IP works.
Thanks. I think I realize the real issues at hand now.
- For whatever reason it seems that broadcast capability of the built-in Juce module is not backwards compatible with OSC receivers built using the danlin_modules on older versions of Juce
- More seriously, broadcast communication between components on the same machine over OSC is entirely dependent on network settings, unlike connections on localhost/127.0.0.1 which is independent of network settings and will function correctly even if a machine has no network connection of any kind.
I didn’t find another topic covering it, but is there a way in JUCE to get the netmask?