hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arpita k <arpita...@gmail.com>
Subject How to release the connection in HttpClient 4.0
Date Sun, 19 Sep 2010 06:17:18 GMT
Hi,

I am using HttpClient 4.0 for client and server communication.

Here is my code to open a connection:

HttpParams params = *new* BasicHttpParams();

// Increase max total connection to 200

ConnManagerParams.*setMaxTotalConnections*(params, 5);

// Increase default max connection per route to 20

ConnPerRouteBean connPerRoute = *new* ConnPerRouteBean(5);

ConnManagerParams.*setMaxConnectionsPerRoute*(params, connPerRoute);

Scheme httpsScheme = *new* Scheme("https", socketFactory, 443);

SchemeRegistry schemeRegistry = *new* SchemeRegistry();

schemeRegistry.register(httpsScheme);

ClientConnectionManager cm = *new* ThreadSafeClientConnManager(params,
schemeRegistry);

signClient = *new* DefaultHttpClient(cm, params);

But I am using around 5 connection in the connection pool.but after using
one connection it is not returning back the connection in the connection
pool.It was kept alive.I like  to know how to release the connection so
that  same connection could be used further.

Your help will be appreciated.

Thanks,

Arpita

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message