On Fri, 2008-06-06 at 13:35 +0800, maomaode wrote: > Hi, > > I've filed the issue https://issues.apache.org/jira/browse/HTTPCORE-162 > Testcase patch attached, also paste the stacktrace > > > Some other questions, > > In the NIO client sample, > > ioReactor.connect( > new InetSocketAddress(url.getHost(), 80), > null, > new HttpHost(url.getHost()), > null); > > What's the HttpHost used for? we have InetSocketAddress, isn't it enough?
It represents a virtual host. Consider the following: you want to send a request to www.google.cn or www.google.ru, but you need to connect to the physical host www.google.com > The HttpHost actually can not pass in the path/port/query information > into the handler, > So I think we can just pass in URL instead of HttpHost, right? > You can pass any object as an attachment to the connection. The same object will passed to the HttpRequestExecutionHandler#initalizeContext upon after the connection has been established. http://hc.apache.org/httpcomponents-core/httpcore-nio/xref/org/apache/http/nio/protocol/HttpRequestExecutionHandler.html#66 > > And another question is, is it possible to use the IP addresss in the > InetSocketAddress? Yes, it is. > The reason is that I want to cache the IP-Host mapping, so there's no > DNS resolve time in the crawler. > > Thanks, > James > Hope this helps Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]