hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject RE: Persistent connection
Date Thu, 20 Apr 2006 08:21:21 GMT
On Thu, 2006-04-20 at 10:54 +0530, khan.sajid@wipro.com wrote:
> >>HttpClient reuses persistent connections very aggressively. If a
> connection can be kept alive and reused for subsequent >>requests it
> will be.
> 
> Thanks for the info Oleg,however,can I please have some more detail on
> using persistent connection aggressively, 

Sajid,

You can see the algorithm here

http://jakarta.apache.org/commons/httpclient/xref/org/apache/commons/httpclient/HttpMethodBase.html#878

Essentially 
(1) all HTTP/1.1 connections will be reused unless 'Connection: close'
directive is sent in the response header; 
(2) HTTP/1.0 connections will be reused provided the 'Connection:
keep-alive' directive is sent in the response header. 

Oleg

> even
> java.net.HttpURLConnection re-uses connection for subsequent request as
> long as we don't send "Connection:close" header in the request
> 
> -Sajid
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, April 20, 2006 12:53 AM
> To: HttpClient User Discussion
> Subject: Re: Persistent connection
> 
> khan.sajid@wipro.com wrote:
> > Thanks, however any idea on what are the improvements of HTTP client
> > over java.net.HttpURLConnection with regard to persistent connection
> >
> > -Sajid
> >  
> Sajid,
> 
> HttpClient reuses persistent connections very aggressively. If a
> connection can be kept alive and reused for subsequent requests it will
> be.
> 
> I have no idea about java.net.HttpURLConnection. When I last tried it
> (admittedly a long time ago), it was completely broken. Moreover, we are
> not supposed to look at the Sun's proprietary code for legal reasons.
> 
> Oleg
> > -----Original Message-----
> > From: Sam Gw [mailto:samgw@ebsuccess.com]
> >
> > Sent: Wednesday, April 19, 2006 11:10 AM
> > To: HttpClient User Discussion
> > Subject: Re: Persistent connection
> >
> > Maybe you could download source code from Sun. And try to understand
> > HttpURLConnection class.
> > I ever read it long time ago. But I forget the difference between
> them.
> > All I remember is HttpURLConnection doesn't fine handle connection.
> >
> > Sam
> >
> > khan.sajid@wipro.com wrote:
> >  
> >> Any comments on this. please reply , Thanks in Advance
> >>
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: Sajid Khan (WT01 - Computing Systems & Storage)
> >>
> >> Sent: Tuesday, April 18, 2006 11:43 AM
> >> To: 'httpclient-user@jakarta.apache.org'
> >> Subject: Persistent connection
> >>
> >>
> >> Hi All,
> >>
> >>
> >> If Sun's HttpURLConnection is used with HTTP 1.1 then by default HTTP
> >> 1.1 uses persistent connection.The documentation of HTTPClient also
> >>    
> >
> >  
> >> tells us that persistent connection is used. My question is what is
> >>    
> >
> >  
> >> the exact difference in terms of persistent connection between java's
> >>    
> >
> >  
> >> HttpURLConnection and HTTPClient. which is better, how can we measure
> >>    
> > ?
> >  
> >> Kindly let me know
> >>
> >>
> >> Thanks,
> >> Sajid
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> The information contained in this electronic message and any
> >>    
> > attachments to this message are intended for the exclusive use of the
> > addressee(s) and may contain proprietary, confidential or privileged
> > information. If you are not the intended recipient, you should not
> > disseminate, distribute or copy this e-mail. Please notify the sender
> > immediately and destroy all copies of this message and any
> attachments.
> >  
> >> WARNING: Computer viruses can be transmitted via email. The recipient
> >>    
> > should check this email and any attachments for the presence of
> viruses.
> > The company accepts no liability for any damage caused by any virus
> > transmitted by this email.
> >  
> >> www.wipro.com
> >> 
> >>    
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > httpclient-user-help@jakarta.apache.org
> >
> >
> >
> > The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain proprietary, confidential or privileged
> information. If you are not the intended recipient, you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately and destroy all copies of this message and any attachments.
> >
> >
> > WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
> >
> >
> > www.wipro.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > httpclient-user-help@jakarta.apache.org
> >
> >
> >  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 
> 
> The information contained in this electronic message and any attachments to this message
are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments.
> 
> WARNING: Computer viruses can be transmitted via email. The recipient should check this
email and any attachments for the presence of viruses. The company accepts no liability for
any damage caused by any virus transmitted by this email.
> 
> www.wipro.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message