Code example for InetSocketAddress

Methods: getAddress, isUnresolved

    protected String getHost(InetSocketAddress isa) {
        //@@@ Will this work with literal IPv6 addresses, or do we 
        //@@@ need to wrap these in [] for the string representation? 
        //@@@ Having it in this method at least allows for easy workarounds. 
       return isa.isUnresolved() ?
            isa.getHostName() : isa.getAddress().getHostAddress();
     * Chooses a proxy from a list of available proxies. 
     * The default implementation just picks the first non-SOCKS proxy 
     * from the list. If there are only SOCKS proxies, 
     * {@link Proxy#NO_PROXY Proxy.NO_PROXY} is returned. 
     * Derived classes may implement more advanced strategies, 
     * such as proxy rotation if there are multiple options. 
     * @param proxies   the list of proxies to choose from, 
     *                  never <code>null</code> or empty 
     * @param target    the planned target, never <code>null</code>