OSC sender IP address


I am working on a project, where the remote needs to send back data via OSC to the sender. Thus, is it possible to find out, which IP address was used to send the OSC message? Actually, only the remote needs to know it. Thus, I either need to find out the address of the interface that is used by OSCsender or I need to find out the IP address where the OSCmessage came from on receiver side. Does anyone have an idea?


Hi Raphael, I’m looking for the same thing: I have an OSCReceiver that needs to be able to “reply” to the sender. Looking under the hood, OSCReceiver calls DatagramSocket::read(), and there are two overloaded versions of that function:
(a) DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock);
(b) DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock, String& senderIPAddress, int& senderPort);

The (b) version populates the sender’s IP address, but OSCReceiver only uses the (a) version. So unless I’m missing something, the only way to get what you’re looking for is to modify the library.

Maybe a feature request to populate the sender’s IP and port as optional arguments in the OSCReceiver::Listener::oscMessageReceived() would be appropriate?