public static InetSocketAddress createInetSocketAddress ( String hostname , int port , boolean resolve ) { InetSocketAddress inetAddressForIpString = createForIpString ( hostname , port ) ; if ( inetAddressForIpString != null ) { return inetAddressForIpString ; } else { return resolve ? new InetSocketAddress ( hostname , port ) : InetSocketAddress . createUnresolved ( hostname , port ) ; } }
Creates InetSocketAddress instance . Numeric IP addresses will be detected and resolved without doing reverse DNS lookups .