Register / Login
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Sockets and Internet Protocols
InetAddress.getLocalHost() execution time on Linux
posted 6 years ago
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
Boost this thread!
run linux command in java
IDEA IntelliJ Startup Problems
same IP address in /etc/hosts
how to get IP address in linux
How to know that my system have Internet connectivity through JAVA