public static synchronized String getLocalHostName ( int timeoutMs ) { if ( sLocalHost != null ) { return sLocalHost ; } try { sLocalHost = InetAddress . getByName ( getLocalIpAddress ( timeoutMs ) ) . getCanonicalHostName ( ) ; return sLocalHost ; } catch ( UnknownHostException e ) { throw new RuntimeException ( e ) ; } }
Gets a local host name for the host this JVM is running on .