hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <mbe...@gmail.com>
Subject Re: testing TimeoutController problem
Date Thu, 24 Mar 2005 04:08:55 GMT
Hi Diego,

>     My questions are:
> 
>     1.- executeMethod does not declare that throws a java.net.SocketException. In javadocs
it only says it throws IOException, HttpException, is that correct?

Yes, SocketException is a subclass of IOException

> 2.- If I call after first request: method.abort() and method.releaseConnection(), I thought
it should close the socket and the second request would be ok, but nothing changes. Is there
any way to close the socket after a request calling a method? If I include the header "Connection:
close", the socket is closed between requests and the three requests completes fine, but I
would prefer to do it calling a method.

Calling abort() will only close the connection if it has not already
been released.  Connections are automatically released by a method
when the response has been fully read.  The best way to ensure a
connection is closed is to override the
connectionManager.releaseConnection() method.  You can then customize
if/when a connection is closed on release.

Using the timeout controller the way you describe is probably not the
best way to test the reliability of the
MultiThreadedHttpConnectionManager.  Having said that you may want to
try overriding interrupt() inside ExecuteThread and call abort() and
releaseConnection() before calling super.interrupt().

Mike

---------------------------------------------------------------------
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