Skip to main content

Retrieve local addresses

No replies
itamar123
Offline
Joined: 2009-04-20
Points: 0

Hello,
I have 2 ip's on my computer IP1 and IP2.
I would like to retrieve the local addresses of my comuter.
i am using the code:
String[] addresses = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
What is the order of the ips in the array 'addresses' ?
Is it random? or is there any order ?
if it does has an order how does it is set?

Itamar.