hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pere LluĂ­s Albert <pere.lluis.alb...@gmail.com>
Subject Warnig in HttpClient Timeout
Date Wed, 11 Feb 2009 10:07:47 GMT
Hello,

I get this warning when I have a HTTP Timeout

SimpleHttpConnectionManager being used incorrectly.  Be sure that
HttpMethod.releaseConnection() is always called and that only one
thread and/or method is using this connection manager at a time.

Is it normal? Am I doing something incorrectly or is it a bug?


Here is the code:

-------------------------------------------------------------------------------------------------------

HttpClient client = new HttpClient();

PostMethod method = new PostMethod(strMyInterface);

// setting Timeout
client.getParams().setParameter("http.socket.timeout", 10000);


try {

  // Execute the method.
  int statusCode = client.executeMethod(method);

  // Read the response body.
  byte[] responseBody = method.getResponseBody();


} catch (HttpException e) {

  System.err.println("Fatal protocol violation: " + e.getMessage());
  e.printStackTrace();

} catch (IOException e) {

  System.err.println("Fatal transport error: " + e.getMessage());
  e.printStackTrace();

} finally {

  // Release the connection.
  method.releaseConnection();

}

---------------------------------------------------------------------------------------------------------------------------------

Thanks in advance.

Pere

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


Mime
View raw message