OSC sender IP address

Hello,

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?

Raphael

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?

Revieving this old thread:

I have the same problem, that I want to read out the IP / Port of a received OSC-Message, so that my server can reply to its clients, without them having to send their ip each time.

There is also this pull request https://github.com/juce-framework/JUCE/pull/543/files
which implements excactly that (as far as I can tell).

Any news on this topic?
Thanks in advance

bump