Dear Oleg:
Thanks for your reply. And here is my simple code (usging
httpclient4.0-beta2):

private void initHttpClient() {
SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(
                new Scheme("http", PlainSocketFactory.getSocketFactory(),
80));
httpParams = new BasicHttpParams();
HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1);
this.setMaxTotalConnections(DEFAULT_MAX_TOTAL_CONNECTIONS);
this.setReadTimeout(DEFAULT_READ_TIMEOUT);
ClientConnectionManager cm = new ThreadSafeClientConnManager(
httpParams, schemeRegistry);
httpClient = new DefaultHttpClient(cm, httpParams);
}


On Tue, Dec 23, 2008 at 10:51 PM, Oleg Kalnichevski <[email protected]>wrote:

> On Mon, 2008-12-22 at 17:46 +0800, alin(王霖) wrote:
> > HI:
> > I use httpclient3 and httpclient4 for a multi-thread load test,  and
> > always set http request header with "Connection:Keep-Alive".
> > When i input command "netstat -na | grep myserverhost:myserverport" in
> > console(My system is windows xp + cygwin) ,  output  like following:
> >
> > C:\Documents and Settings\lin.wangl>netstat -na | grep
> 192.168.208.110:80
> >   TCP    10.1.26.82:4159        192.168.208.110:80     ESTABLISHED
> >   TCP    10.1.26.82:4160        192.168.208.110:80     ESTABLISHED
> >
> > But the ports of client connections(here is 10.1.26.82)  is changing
> while
> > load test is running.
> > through log4j, httpclient4 told me:
> >
> > 17:33:33,049 DEBUG DefaultRequestDirector:463 - Connection can be kept
> alive
> > for 15000 ms
> > 17:33:33,065 DEBUG ThreadSafeClientConnManager:221 - Released connection
> is
> > reusable.
> > 17:33:33,065 DEBUG ConnPoolByRoute:374 - Releasing connection
> > [HttpRoute[{}->http://192.168.208.110]][null]
> > 17:33:33,065 DEBUG ConnPoolByRoute:394 - Pooling connection
> [HttpRoute[{}->
> > http://192.168.208.110]][null]; keep alive for 15000 MILLISECONDS
> >
> > Who can tell me why this is?
> >
> >
>
>
> It is just not possible to tell from 16 milliseconds of logs.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Yours sincerely
alin

Reply via email to