Hello,

A colleague of mine uses httpclient, and is lacking the ability
to close a connection at once. It said to me that invoking
method.releaseConnection() can be a problem for him when the
server is going nuts (sending data with no end), with the extra
problem of deadlocking the java thread forever
(method.releaseConnection() blocked forever, so even stopping
cleanly tomcat becomes impossible). He said the stream seems to
be read to its end, and he suspects this behaviour is necessary
for keep-alive connections.

He added the following method in HttpMethodBase (HttpClient
version 2):

-=-=---=-=---=-=---=-=---=-=---=-=---=-=--
public void closeConnection() {
    responseStream = null;
    if (responseConnection != null) {
        responseConnection.setLastResponseInputStream(null);
        responseConnection.close();
    }
    this.connectionCloseForced = false;
    doneWithConnection = true;
    if (!inExecute) {
        ensureConnectionRelease();
    }
}
-=-=---=-=---=-=---=-=---=-=---=-=---=-=--

I'm wondering if you have any thoughts about that?

-- 
Guillaume Cottenceau

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to