Thanks for your response, I have tried various approaches to this. A common issue I have encountered is synchronising a slider on multiple clients. The problem is trying to get the server to forward slider change messages to other clients without looping it back to the sender (as the transport delay causes the slider to jump around all over the place).
Using basic addressing alone “/slider1”, there is no way to know where the value originated from. The OSC Receiver doesn’t provide any details about the sender, only the OSCMessage itself.
The OSC address could be “/clientID/slider1”
The problem with this is that the OSCReceiver::ListenerWithAddress is not able to register a listener with a wildcard in the address as this is not allowed in the OSC specification. As this is the case, every slider would have to register a listener for every client. Once the server has received the message it would would have to extract the client ID from the address and create a new message for each of the other clients with the correct client address.
It would be possible to write a custom OSCReceiver message router to allow the server receiver to listen to wildcard addresses but this means rewriting all of the OSCReceiver stuff! Another option would be to put the clientID as the first argument in every message but this also means copying the message to forward to the other clients.
It would be much simpler if the client didn’t need to put the clientID in the address or arguments. I figured that the server could open a new port for each client and reply with the port number to send to. Then the server will be able to identify the client based on which OSCReceiver it came in on. Alternitively, the OSCReceiver class could provide the source address & port for each OSCMessage received via UDP?
For my multiple port idea to work, I would need OSCReceiver to prevent port reuse so that I could identify an unused port for each client. I am wondering whether it would be a valid case for port reuse to be disabled on OSCReceiver by default or for there to be a method to switch this in the OSCReceiver class.