Hi Sean,

Thanks for reporting your progress. 

Reading your response, it seems that the other HTTP client connector based
on HttpURLConnection class would also allow you to reuse connections if you
fully read the responses. It would be great if you could confirm that it
works equally well with both connectors.

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de Sean Landis
> Envoyé : mardi 28 novembre 2006 00:39
> À : [email protected]
> Objet : Re: Connection reuse again
> 
> Sean Landis <sean.landis <at> gmail.com> writes:
> 
> > 
> > I am using the new apache http client and I'm seeing 
> strange behavior. I am
> > sending 50 messages to the server in rapid succession. 
> Using the 'ethereal' 
> > tool, I examined the TCP traffic. What I saw was that 
> occasionally the 
> > connection would get reused once, that is, two calls would 
> occur before the
> > connection was closed. In the other cases, I think 45, the 
> connection was 
> > closed after the first call.
> 
> I figured out my problem. I was reviewing a link Jerome had 
> referred me to,
> http://java.sun.com/j2se/1.5.0/docs/guide/net/http-keepalive.html
> and saw this:
> 
> "Do not abandon a connection by ignoring the response body. 
> Doing so may results 
> in idle TCP connections. That needs to be garbage collected 
> when they are no
> longer referenced."
> 
> I added: 
> 
> tmp = reply.getOutput();
> 
> and connections remained open.
> 
> Sean

Reply via email to