commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex <alexn...@optonline.net>
Subject [commons-httpclient] setConnectionTimeout not working?
Date Mon, 24 Apr 2006 22:38:15 GMT
  client = new HttpClient();

 

SimpleHttpConnectionManager mr = new SimpleHttpConnectionManager();

mr.getParams().setConnectionTimeout(1000);

client = new HttpClient(mr);   

 

 

long startTime = System.currentTimeMillis();

int resultCode = client.executeMethod(getMethod);  

setConnTime(System.currentTimeMillis()-startTime);  

 

 

my connection timeout is set to 1000 (1 second),  output shows that
connection to some site took over 3-4 seconds and 

it never comes to "catch (ConnectTimeoutException e)"  

 

 

why is it not throwing ConnectTimeoutException?


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