On Sun, 2012-12-23 at 23:03 -0800, vigna wrote:
> I'm trying to convince DefaultHttpAsyncClient to use DNSJava instead of the
> standard Java DNS. With DefaultHttpClient it is not difficult by using a
> specialized DefaultConnectionOperator:
> 
>               DefaultHttpClient httpClient = new DefaultHttpClient( new
> BasicClientConnectionManager() {
>                       @Override
>                       protected ClientConnectionOperator 
> createConnectionOperator(
> SchemeRegistry schreg ) {
>                               return new DefaultClientConnectionOperator( 
> schreg, new DnsResolver() {
>                                       @Override
>                                       public InetAddress[] resolve( String 
> host ) throws UnknownHostException
> {
>                                               return Address.getAllByName( 
> host );
>                                       }
>                               });
>                       }
>               });
> 
> I couldn't find any way to obtain the same result with
> DefaultHttpAsyncClient. Any help appreciated!
> 
> 

You'll need to override AbstractNIOConnPool#resolveRemoteAddress
method. 

Unfortunately there is currently no way to subclass the connection pool
class used internally by PoolingClientAsyncConnectionManager so you will
have to create a whole new custom connection manager in order to
override the default DNS resolution logic. Feel free to raise a JIRA for
this issue.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to