What's my IP?


#1

Hi,
I’m using the InterprocessConnectionServer to listen for incoming connections from other computers on the LAN.
To aid with the connection wish to display on the app window, what IP you’d need to connect.

(Normally, you’d not specify this address your self so you probably don’t know it, whereas it would be “all available addresses”,
including 127.0.0.1 and the interface IP in question.)

Is there a Juce API to reveal the IP address you are listening to?

I’d be grateful for any help you might have. Worst case, I’d just use the different OS APIs.

/Michael


#2

I haven’t used these classes myself yet, but looking at the docs, it seems that when you override createConnectionObject you must create and return an InterprocessConnection? Then you can call InterprocessConnection::getHostName?


#3

Sorry, wont work, for two reasons. getHostName is the address of the connecting client, whereas I need to know my own server address. Also, when returning the InterprocessConnection object, there has already been a connection so there’s a causality problem there… :wink:

Thank you anyway. I appreciate it :slight_smile: