You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gustavo Hexsel <gh...@sagebrushcorp.com> on 2004/10/08 19:11:19 UTC

RE: [HttpClient] getting the http connection or setting the param s

  I already have a reference to the input stream - the method was already
executed.  Will it still set the timeout for the socket?

  []s Gustavo


-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@bluewin.ch]
Sent: October 8, 2004 11:07 AM
To: 'Jakarta Commons Users List'
Subject: RE: [HttpClient] getting the http connection or setting the
param s


On Fri, 2004-10-08 at 17:41, Gustavo Hexsel wrote:
>   Hi Michael,
> 
>   thanks for the prompt answer.
> 
>   By connection params I meant the HttpConnection.setParams().  I saw the
> javadoc for that class, and it states that if I set SO_TIMEOUT there, it
> will change the value for open sockets as well.  If I just set the method
> parameters, by calling HttpBaseMethod.setParams(), it will change the
> parameter only when opening new sockets. 

Gustavo,
This is not the case. HttpClient resets SO_TIMEOUT every time the
connection is obtained from the connection manager, because the
connection can be still left open ('alive') and may contain an arbitrary
SO_TIMEOUT value set by the previous method. 

When SO_TIMEOUT is defined at the HTTP method, the method value is used,
otherwise, default value defined at the HTTP connection/connection
manager level is used.

http://jakarta.apache.org/commons/httpclient/3.0/xref/org/apache/commons/htt
pclient/HttpMethodDirector.html#379

Oleg


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

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


Re: [HttpClient] getting the http connection or setting the param s

Posted by Michael Becke <be...@u.washington.edu>.
Yes, setting the timeout will not effect methods that have already been 
executed.  Even if it did, I'm not sure it would help much in this case. 
  Gustavo, is sounds like you want a per method execution timeout.  The 
SO_TIMEOUT is for each individual read operation at the socket level.

Mike

Oleg Kalnichevski wrote:
> On Fri, 2004-10-08 at 19:11, Gustavo Hexsel wrote:
> 
>>  I already have a reference to the input stream - the method was already
>>executed.  Will it still set the timeout for the socket?
>>
>>  []s Gustavo
> 
> 
> 
> All right. I see. It will not. Feel free to file a feature request. It
> is still not too late to have this included into the 3.0 release 
> 
> Oleg
> 
> 
> 
>>
>>-----Original Message-----
>>From: Oleg Kalnichevski [mailto:olegk@bluewin.ch]
>>Sent: October 8, 2004 11:07 AM
>>To: 'Jakarta Commons Users List'
>>Subject: RE: [HttpClient] getting the http connection or setting the
>>param s
>>
>>
>>On Fri, 2004-10-08 at 17:41, Gustavo Hexsel wrote:
>>
>>>  Hi Michael,
>>>
>>>  thanks for the prompt answer.
>>>
>>>  By connection params I meant the HttpConnection.setParams().  I saw the
>>>javadoc for that class, and it states that if I set SO_TIMEOUT there, it
>>>will change the value for open sockets as well.  If I just set the method
>>>parameters, by calling HttpBaseMethod.setParams(), it will change the
>>>parameter only when opening new sockets. 
>>
>>Gustavo,
>>This is not the case. HttpClient resets SO_TIMEOUT every time the
>>connection is obtained from the connection manager, because the
>>connection can be still left open ('alive') and may contain an arbitrary
>>SO_TIMEOUT value set by the previous method. 
>>
>>When SO_TIMEOUT is defined at the HTTP method, the method value is used,
>>otherwise, default value defined at the HTTP connection/connection
>>manager level is used.
>>
>>http://jakarta.apache.org/commons/httpclient/3.0/xref/org/apache/commons/htt
>>pclient/HttpMethodDirector.html#379
>>
>>Oleg
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 

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


RE: [HttpClient] getting the http connection or setting the param s

Posted by Oleg Kalnichevski <ol...@bluewin.ch>.
On Fri, 2004-10-08 at 19:11, Gustavo Hexsel wrote:
>   I already have a reference to the input stream - the method was already
> executed.  Will it still set the timeout for the socket?
> 
>   []s Gustavo


All right. I see. It will not. Feel free to file a feature request. It
is still not too late to have this included into the 3.0 release 

Oleg


> 
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@bluewin.ch]
> Sent: October 8, 2004 11:07 AM
> To: 'Jakarta Commons Users List'
> Subject: RE: [HttpClient] getting the http connection or setting the
> param s
> 
> 
> On Fri, 2004-10-08 at 17:41, Gustavo Hexsel wrote:
> >   Hi Michael,
> > 
> >   thanks for the prompt answer.
> > 
> >   By connection params I meant the HttpConnection.setParams().  I saw the
> > javadoc for that class, and it states that if I set SO_TIMEOUT there, it
> > will change the value for open sockets as well.  If I just set the method
> > parameters, by calling HttpBaseMethod.setParams(), it will change the
> > parameter only when opening new sockets. 
> 
> Gustavo,
> This is not the case. HttpClient resets SO_TIMEOUT every time the
> connection is obtained from the connection manager, because the
> connection can be still left open ('alive') and may contain an arbitrary
> SO_TIMEOUT value set by the previous method. 
> 
> When SO_TIMEOUT is defined at the HTTP method, the method value is used,
> otherwise, default value defined at the HTTP connection/connection
> manager level is used.
> 
> http://jakarta.apache.org/commons/httpclient/3.0/xref/org/apache/commons/htt
> pclient/HttpMethodDirector.html#379
> 
> Oleg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


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