You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Teja Sai Krishna <sa...@yahoo.com> on 2005/10/17 17:48:04 UTC

CLOSE_WAIT state at the client side

Hi,

We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states.  Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 

Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?

Thanks
Teja
 

Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Oct 17, 2005 at 06:21:54PM +0200, Oleg Kalnichevski wrote:
> On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> > Hi,
> > 
> > We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states.  Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> > 
> > Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> > 
> 
> Not really. That means these connections have been closed by the server
> but the client still assumes they are valid and keeps them in the
> connection pool. The way to go is to implement a custom idle connection
> handler:
> 
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html
> 

My apologies. The link is wrong. The correct link is this one:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionTimeoutThread.html

Oleg

> Hope this helps
> 
> Oleg
> 
> 
> 
> 
> > Thanks
> > Teja
> >  
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 

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


Re: CLOSE_WAIT state at the client side

Posted by Teja Sai Krishna <sa...@yahoo.com>.
Thanks for your reply. Let met try this option as a quick solution.
 
Many Thanks
Teja

Oleg Kalnichevski <ol...@apache.org> wrote:
On Fri, Oct 21, 2005 at 03:09:39PM +0100, Teja Sai Krishna wrote:
> Hi Oleg,
> 
> If I use HTTP 1.0 i.e if i set method.setHttp11(false) this problem should be resolved? 
> 
> I mean CLOSE_WAIT state will be disappear automatically if I use HTTP 1.0 ?
> 
> Thanks
> Teja
> 

Yes, it should, as this will effectively disable the connection
persistence. If you do not care about performance, this should be a very
quick and reliable fix

Oleg

> 
> Oleg Kalnichevski wrote:
> On Mon, Oct 17, 2005 at 06:12:46PM +0100, Teja Sai Krishna wrote:
> > Thanks for your reply.
> > 
> > is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
> >
> 
> The purpose of HttpMethod#releaseConnection() method is to inform the 
> connection manager that the method no longer needs the connection. The 
> connection manager may choose to close the connection depending upon the
> connection reuse policy. Both standard connection managers (simple and
> multithreaded), however, always attempt to keep connections alive per 
> default (that is if HTTP/1.1 is being used and no 'connection: close' 
> directive has been issued). 
> 
> > We are using default connection manager and not using any multithreadedConnection manager. 
> > 
> > Do we need to implement multi threade connection manager to close these idle connections?
> > 
> 
> No, you do not. One can easily use the idle connection handler on the
> simple (non-pooling) connection manager. In your particular case,
> though, you may consider writing a custom connection manager since you
> seem to have application specific requirements as far as connection
> management is concerned
> 
> Oleg
> 
> 
> 
> > My code looks like this.
> > ---------------------
> > 
> > PostMethod method = new PostMethod(url.toExternalForm());
> > DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
> > retryHandler.setRetryCount(0);
> > method.setMethodRetryHandler(retryHandler);
> > HttpClient client = new HttpClient();
> > client.setTimeout(rtimeout);
> > try {
> > method.setRequestBody(psRequestMsg);
> > int statusCode = client.executeMethod(method);
> > results = method.getResponseBodyAsString();
> > }
> > catch(ConnectException cex){
> > 
> > }catch(Exception e){
> > 
> > }finally{
> > method.releaseConnection();
> > }
> > 
> > ---------------------
> > 
> > Thanks
> > Teja
> > 
> > Oleg Kalnichevski wrote:
> > On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> > > Hi,
> > > 
> > > We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> > > 
> > > Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> > > 
> > 
> > Not really. That means these connections have been closed by the server
> > but the client still assumes they are valid and keeps them in the
> > connection pool. The way to go is to implement a custom idle connection
> > handler:
> > 
> > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html
> > 
> > Hope this helps
> > 
> > Oleg
> > 
> > 
> > 
> > 
> > > Thanks
> > > Teja
> > > 
> > > 
> > > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> > 
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, Oct 21, 2005 at 03:09:39PM +0100, Teja Sai Krishna wrote:
> Hi Oleg,
>  
> If I use HTTP 1.0 i.e if i set method.setHttp11(false) this problem should be resolved? 
>  
> I mean CLOSE_WAIT state will be disappear automatically if I use HTTP 1.0 ?
>  
> Thanks
> Teja
> 

Yes, it should, as this will effectively disable the connection
persistence. If you do not care about performance, this should be a very
quick and reliable fix

Oleg

> 
> Oleg Kalnichevski <ol...@apache.org> wrote:
> On Mon, Oct 17, 2005 at 06:12:46PM +0100, Teja Sai Krishna wrote:
> > Thanks for your reply.
> > 
> > is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
> >
> 
> The purpose of HttpMethod#releaseConnection() method is to inform the 
> connection manager that the method no longer needs the connection. The 
> connection manager may choose to close the connection depending upon the
> connection reuse policy. Both standard connection managers (simple and
> multithreaded), however, always attempt to keep connections alive per 
> default (that is if HTTP/1.1 is being used and no 'connection: close' 
> directive has been issued). 
> 
> > We are using default connection manager and not using any multithreadedConnection manager. 
> > 
> > Do we need to implement multi threade connection manager to close these idle connections?
> > 
> 
> No, you do not. One can easily use the idle connection handler on the
> simple (non-pooling) connection manager. In your particular case,
> though, you may consider writing a custom connection manager since you
> seem to have application specific requirements as far as connection
> management is concerned
> 
> Oleg
> 
> 
> 
> > My code looks like this.
> > ---------------------
> > 
> > PostMethod method = new PostMethod(url.toExternalForm());
> > DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
> > retryHandler.setRetryCount(0);
> > method.setMethodRetryHandler(retryHandler);
> > HttpClient client = new HttpClient();
> > client.setTimeout(rtimeout);
> > try {
> > method.setRequestBody(psRequestMsg);
> > int statusCode = client.executeMethod(method);
> > results = method.getResponseBodyAsString();
> > }
> > catch(ConnectException cex){
> > 
> > }catch(Exception e){
> > 
> > }finally{
> > method.releaseConnection();
> > }
> > 
> > ---------------------
> > 
> > Thanks
> > Teja
> > 
> > Oleg Kalnichevski wrote:
> > On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> > > Hi,
> > > 
> > > We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> > > 
> > > Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> > > 
> > 
> > Not really. That means these connections have been closed by the server
> > but the client still assumes they are valid and keeps them in the
> > connection pool. The way to go is to implement a custom idle connection
> > handler:
> > 
> > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html
> > 
> > Hope this helps
> > 
> > Oleg
> > 
> > 
> > 
> > 
> > > Thanks
> > > Teja
> > > 
> > > 
> > > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> > 
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Re: CLOSE_WAIT state at the client side

Posted by Teja Sai Krishna <sa...@yahoo.com>.
Hi Guillaume ,
 
You mean to say if i set  method.setHttp11(false); then it should be fine?
How it depends on HTTP 1.0?. In HTTP 1.0 these connections will be closed automatically?
 
Can you please elaborate the other way to solve this problem i.e Connection:close Header ?
 
Thanks
Regards
Harish
 


Guillaume Cottenceau <gc...@mnc.ch> wrote:
Oleg Kalnichevski writes:

> > Do we need to implement multi threade connection manager to close these idle connections?
> 
> No, you do not. One can easily use the idle connection handler on the
> simple (non-pooling) connection manager. In your particular case,

If I'm correct, he can also choose HTTP/1.0 or simply add a
Connection: close header.

-- 
Guillaume Cottenceau

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


Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Guillaume Cottenceau <gc...@mnc.ch>.
Oleg Kalnichevski <olegk 'at' apache.org> writes:

> > Do we need to implement multi threade connection manager to close these idle connections?
> 
> No, you do not. One can easily use the idle connection handler on the
> simple (non-pooling) connection manager. In your particular case,

If I'm correct, he can also choose HTTP/1.0 or simply add a
Connection: close header.

-- 
Guillaume Cottenceau

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


Re: CLOSE_WAIT state at the client side

Posted by Teja Sai Krishna <sa...@yahoo.com>.
Hi Oleg,
 
If I use HTTP 1.0 i.e if i set method.setHttp11(false) this problem should be resolved? 
 
I mean CLOSE_WAIT state will be disappear automatically if I use HTTP 1.0 ?
 
Thanks
Teja


Oleg Kalnichevski <ol...@apache.org> wrote:
On Mon, Oct 17, 2005 at 06:12:46PM +0100, Teja Sai Krishna wrote:
> Thanks for your reply.
> 
> is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
>

The purpose of HttpMethod#releaseConnection() method is to inform the 
connection manager that the method no longer needs the connection. The 
connection manager may choose to close the connection depending upon the
connection reuse policy. Both standard connection managers (simple and
multithreaded), however, always attempt to keep connections alive per 
default (that is if HTTP/1.1 is being used and no 'connection: close' 
directive has been issued). 

> We are using default connection manager and not using any multithreadedConnection manager. 
> 
> Do we need to implement multi threade connection manager to close these idle connections?
> 

No, you do not. One can easily use the idle connection handler on the
simple (non-pooling) connection manager. In your particular case,
though, you may consider writing a custom connection manager since you
seem to have application specific requirements as far as connection
management is concerned

Oleg



> My code looks like this.
> ---------------------
> 
> PostMethod method = new PostMethod(url.toExternalForm());
> DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
> retryHandler.setRetryCount(0);
> method.setMethodRetryHandler(retryHandler);
> HttpClient client = new HttpClient();
> client.setTimeout(rtimeout);
> try {
> method.setRequestBody(psRequestMsg);
> int statusCode = client.executeMethod(method);
> results = method.getResponseBodyAsString();
> }
> catch(ConnectException cex){
> 
> }catch(Exception e){
> 
> }finally{
> method.releaseConnection();
> }
> 
> ---------------------
> 
> Thanks
> Teja
> 
> Oleg Kalnichevski wrote:
> On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> > Hi,
> > 
> > We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> > 
> > Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> > 
> 
> Not really. That means these connections have been closed by the server
> but the client still assumes they are valid and keeps them in the
> connection pool. The way to go is to implement a custom idle connection
> handler:
> 
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html
> 
> Hope this helps
> 
> Oleg
> 
> 
> 
> 
> > Thanks
> > Teja
> > 
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Oct 17, 2005 at 06:12:46PM +0100, Teja Sai Krishna wrote:
> Thanks for your reply.
>  
> is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
>

The purpose of HttpMethod#releaseConnection() method is to inform the 
connection manager that the method no longer needs the connection. The 
connection manager may choose to close the connection depending upon the
connection reuse policy. Both standard connection managers (simple and
multithreaded), however, always attempt to keep connections alive per 
default (that is if HTTP/1.1 is being used and no 'connection: close' 
directive has been issued). 

> We are using default connection manager and not using any multithreadedConnection manager. 
>  
> Do we need to implement multi threade connection manager to close these idle connections?
>  

No, you do not. One can easily use the idle connection handler on the
simple (non-pooling) connection manager. In your particular case,
though, you may consider writing a custom connection manager since you
seem to have application specific requirements as far as connection
management is concerned

Oleg



> My code looks like this.
> ---------------------
> 
>  PostMethod method = new PostMethod(url.toExternalForm());
>         DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
>         retryHandler.setRetryCount(0);
>         method.setMethodRetryHandler(retryHandler);
>         HttpClient client = new HttpClient();
>         client.setTimeout(rtimeout);
>      try {
>       method.setRequestBody(psRequestMsg);
>             int statusCode = client.executeMethod(method);
>             results = method.getResponseBodyAsString();
>         }
>      catch(ConnectException cex){
>      
>      }catch(Exception e){
>      
>      }finally{
>       method.releaseConnection();
>        }
>  
> ---------------------
>  
> Thanks
> Teja
> 
> Oleg Kalnichevski <ol...@apache.org> wrote:
> On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> > Hi,
> > 
> > We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> > 
> > Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> > 
> 
> Not really. That means these connections have been closed by the server
> but the client still assumes they are valid and keeps them in the
> connection pool. The way to go is to implement a custom idle connection
> handler:
> 
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html
> 
> Hope this helps
> 
> Oleg
> 
> 
> 
> 
> > Thanks
> > Teja
> > 
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Re: CLOSE_WAIT state at the client side

Posted by Teja Sai Krishna <sa...@yahoo.com>.
Hi Oleg,
 
Thanks for your reply.
 
is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
 
We are using default connection manager and not using any multithreadedConnection manager. 
 
Do we need to implement multi threade connection manager to close these idle connections?
 
My code looks like this.
---------------------

 PostMethod method = new PostMethod(url.toExternalForm());
        DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
        retryHandler.setRetryCount(0);
        method.setMethodRetryHandler(retryHandler);
        HttpClient client = new HttpClient();
        client.setTimeout(rtimeout);
     try {
      method.setRequestBody(psRequestMsg);
            int statusCode = client.executeMethod(method);
            results = method.getResponseBodyAsString();
        }
     catch(ConnectException cex){
     
     }catch(Exception e){
     
     }finally{
      method.releaseConnection();
       }
 
---------------------
 
Thanks
Teja

Oleg Kalnichevski <ol...@apache.org> wrote:
On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> Hi,
> 
> We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> 
> Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> 

Not really. That means these connections have been closed by the server
but the client still assumes they are valid and keeps them in the
connection pool. The way to go is to implement a custom idle connection
handler:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html

Hope this helps

Oleg




> Thanks
> Teja
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Teja Sai Krishna <sa...@yahoo.com>.
Thanks for your reply.
 
is method.releaseConnection() will not close these connections?. I thought releaseConnection will take care of releasing the CLOSE_WAIT connections. method.releaseConnection() method will not close the connections completely?.
 
We are using default connection manager and not using any multithreadedConnection manager. 
 
Do we need to implement multi threade connection manager to close these idle connections?
 
My code looks like this.
---------------------

 PostMethod method = new PostMethod(url.toExternalForm());
        DefaultMethodRetryHandler retryHandler = new DefaultMethodRetryHandler();
        retryHandler.setRetryCount(0);
        method.setMethodRetryHandler(retryHandler);
        HttpClient client = new HttpClient();
        client.setTimeout(rtimeout);
     try {
      method.setRequestBody(psRequestMsg);
            int statusCode = client.executeMethod(method);
            results = method.getResponseBodyAsString();
        }
     catch(ConnectException cex){
     
     }catch(Exception e){
     
     }finally{
      method.releaseConnection();
       }
 
---------------------
 
Thanks
Teja

Oleg Kalnichevski <ol...@apache.org> wrote:
On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> Hi,
> 
> We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states. Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> 
> Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> 

Not really. That means these connections have been closed by the server
but the client still assumes they are valid and keeps them in the
connection pool. The way to go is to implement a custom idle connection
handler:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html

Hope this helps

Oleg




> Thanks
> Teja
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: CLOSE_WAIT state at the client side

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Oct 17, 2005 at 04:48:04PM +0100, Teja Sai Krishna wrote:
> Hi,
> 
> We have HTTP Client application that connects to the HttpListening Connector, which runs on weblogic 8.1. I have observed some strange behaviour at my client side connection states.  Once the communication is over, some client side connections are in CLOSE_WAIT state. Some times I have seen these CLOSE_WAIT connections will disappear after one day. But most of the times it will not disappear even after one day. I have to kill my application. 
> 
> Is CLOSE_WAIT at the client side means, my client is waiting for final acknowledgement from the server?
> 

Not really. That means these connections have been closed by the server
but the client still assumes they are valid and keeps them in the
connection pool. The way to go is to implement a custom idle connection
handler:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/util/IdleConnectionHandler.html

Hope this helps

Oleg




> Thanks
> Teja
>  
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 

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