dasInStream = open(url);
} catch (Exception e ){
comeBackLater = -1;
+ System.out.println("NO RESPONSE FROM "+url);
logger.log(Level.FINE,"could not open connection to " + url,e);
return ;
}
//logger.finest("opening "+url);
+ int timeout = 10000;
+ System.setProperty("sun.net.client.defaultConnectTimeout", timeout+"");
+ System.setProperty("sun.net.client.defaultReadTimeout", timeout+"");
+
// use reflection to determine if get and set timeout methods for urlconnection are available
// seems java 1.5 does not watch the System properties any longer...
// and java 1.4 did not provide these...
// for 1.4 see setSystemProperties
- int timeout = 15000;
+
try {
// try to use reflection to set timeout property
Class urlconnectionClass = Class.forName("java.net.HttpURLConnection");
- Method setconnecttimeout = urlconnectionClass.getMethod (
+ Method setconnecttimeout = urlconnectionClass.getMethod (
"setConnectTimeout", new Class [] {int.class}
);
setconnecttimeout.invoke(huc,new Object[] {new Integer(timeout)});