> Hi,
>
[quoted text clipped - 5 lines]
>
> That is, I don't want to have to wait for the "default" timeout.
[snip]
You can't do this using Sun's classes unless you use a "private"
property setting. Unfortunately, the setting is not guaranteed to
remain the same (or remain at all).
I've just been working on a similar task and used the
Commons-HTTPClient[1] from Apache. It allows you to specify both a
connection timeout and also a timeout when reading the response. It
works superbly!
[1] http://jakarta.apache.org/commons/httpclient/

Signature
Dave Ockwell-Jenner
Solar Nexus Solutions
http://www.solar-nexus.com/
Adam P. Jenkins - 13 Apr 2005 02:59 GMT
>> Hi,
>>
[quoted text clipped - 18 lines]
>
> [1] http://jakarta.apache.org/commons/httpclient/
Actually Sun has added this in Java 1.5. See the java.net.URLConnection
setConnectionTimeout() and setReadTimeout() methods. If you need
to use an earlier version of Java then the Jakarta HTTPClient package
works great.