B
Brent
I'm not "real" familiar with Java, but enough to get around. However,
I'm seemingly having a problem getting a URL connection to timeout
correctly using HttpClient. Example code follows:
// Create HTTP Client
int theTimeOut = Integer.parseInt(TimeOutTime); // TimeOutTime is a
String = "5" (testing purposes)
theTimeOut = (theTimeOut * 1000);
HttpClient client = new HttpClient();
client.getParams().setParameter("http.socket.timeout", new
Integer(theTimeOut));
// Create method to get URL
GetMethod get = new GetMethod("http://10.0.14.200:8201");
get.getParams().setParameter("http.socket.timeout", new
Integer(theTimeOut));
// Try to retrieve URL
client.executeMethod(get);
.......blah blah blah blah
Basically, the server http://10.0.14.200:8201 does not exist, so
instead of timing out in 5 seconds as it should, it takes, I don't
know, at least a minute.
Any ideas why it doesn't timeout as it should trying to connect?
What am I missing here.
JDK 1.4.2 is what I'm running.
-Brent
I'm seemingly having a problem getting a URL connection to timeout
correctly using HttpClient. Example code follows:
// Create HTTP Client
int theTimeOut = Integer.parseInt(TimeOutTime); // TimeOutTime is a
String = "5" (testing purposes)
theTimeOut = (theTimeOut * 1000);
HttpClient client = new HttpClient();
client.getParams().setParameter("http.socket.timeout", new
Integer(theTimeOut));
// Create method to get URL
GetMethod get = new GetMethod("http://10.0.14.200:8201");
get.getParams().setParameter("http.socket.timeout", new
Integer(theTimeOut));
// Try to retrieve URL
client.executeMethod(get);
.......blah blah blah blah
Basically, the server http://10.0.14.200:8201 does not exist, so
instead of timing out in 5 seconds as it should, it takes, I don't
know, at least a minute.
Any ideas why it doesn't timeout as it should trying to connect?
What am I missing here.
JDK 1.4.2 is what I'm running.
-Brent