Return-Path: Delivered-To: apmail-jakarta-httpclient-dev-archive@www.apache.org Received: (qmail 375 invoked from network); 21 Oct 2005 14:11:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Oct 2005 14:11:46 -0000 Received: (qmail 19919 invoked by uid 500); 21 Oct 2005 14:11:45 -0000 Delivered-To: apmail-jakarta-httpclient-dev-archive@jakarta.apache.org Received: (qmail 19900 invoked by uid 500); 21 Oct 2005 14:11:44 -0000 Mailing-List: contact httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "HttpClient Project" Reply-To: "HttpClient Project" Delivered-To: mailing list httpclient-dev@jakarta.apache.org Received: (qmail 19889 invoked by uid 99); 21 Oct 2005 14:11:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2005 07:11:44 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_10_20,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [209.191.68.220] (HELO web35111.mail.mud.yahoo.com) (209.191.68.220) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 21 Oct 2005 07:11:43 -0700 Received: (qmail 77442 invoked by uid 60001); 21 Oct 2005 14:09:39 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZihL8vPIb4150wMtLGrXdXptlMECsvk+JcwW/dBE2f53D2vYjNXKxdT6LxFdPgSFyCHN6+Qhi+BicLnqL+aJ/paUDHJ6i9lSVUaXj3WG3c3cclzVYOfJNoAJks9BDjVslUJWhPVOZm3mS/6xofyaPcj4x2DyQgzB4RWL3eYzJWI= ; Message-ID: <20051021140939.77440.qmail@web35111.mail.mud.yahoo.com> Received: from [195.10.3.194] by web35111.mail.mud.yahoo.com via HTTP; Fri, 21 Oct 2005 15:09:39 BST Date: Fri, 21 Oct 2005 15:09:39 +0100 (BST) From: Teja Sai Krishna Subject: Re: CLOSE_WAIT state at the client side To: HttpClient Project In-Reply-To: <20051017174759.GA4888@uml24.umlhosting.ch> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1391711660-1129903779=:73498" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-1391711660-1129903779=:73498 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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 --0-1391711660-1129903779=:73498--