private static String getHostAddress ( InetSocketAddress addr ) { String hostToAppend = "" ; if ( addr . isUnresolved ( ) ) { hostToAppend = addr . getHostName ( ) ; } else { hostToAppend = addr . getAddress ( ) . getHostAddress ( ) ; } return hostToAppend ; }
Returns the address of the host minimizing DNS lookups .