• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

InetAddress.getLocalHost() execution time on Linux

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need to get the ip of my machine, and noticed that InetAddress.getLocalHost() is slower than expected on my Fedora 12 machine.

Each call takes between 30 and 100 milliseconds.

However, the "hostname" command executes in 1 millisecond.

Also, on my windows system, this is a lot faster.

i have checked the /etc/hosts and also the /etc/nsswitch.conf points to the /etc/hosts file first.

Can anyone explain why the call takes so much time?

thanks a lot

Ben
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic