public static InetAddress getLocalHost ( ) { if ( localHost == null ) { try { localHost = java . net . InetAddress . getLocalHost ( ) ; } catch ( UnknownHostException e ) { LOGGER . error ( "Cannot get local host address. exception is: " + e ) ; localHost = null ; hostName = "UNKNOWN" ; ipAddress = "UNKNOWN" ; } } return localHost ; }
get the local host ip address .