• Post Reply Bookmark Topic Watch Topic
  • New Topic

InetAddress puzzle: Windows and Linux

 
Arun Bommannavar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
InetAddress addr = InetAddress.getLocalHost();

gives correct Ip Address on my Windows machine but gives local loop back adress (127.0.0.1) for a Linux machine. Why?
 
Dave Michels
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you check the JavaDoc on this method you can see the following:



It could very well be a case of the above, and a difference in the configurations of the security managers across the OS's (and possibly versions of the JRE that is being used).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!