You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Karsten Silz (JIRA)" <ji...@apache.org> on 2007/07/17 20:46:04 UTC

[jira] Closed: (HTTPCLIENT-671) setSoTimeout() doesn't seem to work

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karsten Silz closed HTTPCLIENT-671.
-----------------------------------


Stupid me!  Thank you!

> setSoTimeout() doesn't seem to work
> -----------------------------------
>
>                 Key: HTTPCLIENT-671
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-671
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpConn
>    Affects Versions: 3.0.1
>         Environment: Windows XP SP2, 1.4.2_13-b06
>            Reporter: Karsten Silz
>
> I try to use the socket timeout for an HttpClient instance, but it isn't working.  Here's my code (approximately):
> Class attributes:
>   private static final int TIMEOUT = 15 * 1000;
>   private final HttpClient browser     = new HttpClient();
> Constructor:
> 	HttpConnectionManager httpConnectionManager = new SimpleHttpConnectionManager();
> 	httpConnectionManager.getParams().setSoTimeout(TIMEOUT);
> 	browser.setHttpConnectionManager(httpConnectionManager);
> Method:
>     final GetMethod request = new GetMethod(initialUrl);
>     request.setFollowRedirects(true);
>     final HttpMethodParams parameters = request.getParams();
>     parameters.setSoTimeout(TIMEOUT);
>     request.setParams(parameters);
>     int responseCode = browser.executeMethod(request );
> Now I hit a URL with a non-existing IP address, and instead of 15 seconds it times out after pretty much 84 seconds.  What is wrong here

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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