hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clemens Marschner" <Clemens.Marsch...@internet.lmu.de>
Subject DNS // NIO
Date Fri, 25 Jul 2003 17:24:08 GMT

there are two issues I would like to bring up that were mentioned in this
list during the last months but were never resolved:

1. Java DNS handling as done by java.net.Socket is very inefficient for
applications that open connections to many different hosts.
This is due to a host name cache inside java.net.Socket. It contains a list
of host names and the expiry time of each cache entry. Whenever a connection
to a new host is made, the name is looked up in the cache. The first thing
this cache does is iterate through the whole list of entries and kick out
all expired entries. This means the operation uses
O(number of cached hosts) time (and if I recall right, also memory, since
the cache doesn't have an upper limit) each time that a socket connection is

This could be avoided by issueing only the IP address to java.net.Socket and
thus to HTTPClient. However, it is necessary to pass the host name to
HTTPClient in order to resolve multiple host names per IP address within the
HTTP request.

Do you have any plans to plug in an external DNS resolver and create a
Socket only with the IP address?

2. Are there any people working on a NIO based version of HTTPClient? I saw
some notes on this on a weblog, but haven't seen any results.



View raw message