Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CLOSE_WAIT state at the HTTP Client side

Status
Not open for further replies.

askteja

Technical User
Oct 13, 2005
1
0
0
GB
Hi,

We have HTTP Client application that connects to the HttpListening Connector , which runs on weblogic 8.1.

We are using apache's HTTPClient API to connect to the server.

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 ack from the server?

Could you please suggest , how to resolve this issue?

My client code looks like this . I am releasing the connection after the communication happens.

--------------
HttpClient client = new HttpClient();

// Create a method instance.
GetMethod method = new GetMethod(url);

// Provide custom retry handler is necessary
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
method.setRetryCount(0);

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

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

System.out.println(new String(responseBody));

} catch (HttpException e) {

e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
// Release the connection.
method.releaseConnection();
}
}
}-------------

Thanks
Regards
Teja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top