Name: dbT83986 Date: 02/27/99
When waiting for a cgi response I find it can often be faster
just to drop the current connection and make a new one if it
hasn't loaded after a second or two.
I was unable to find what should have been a simple solution to
retry the url after only a couple of seconds had passed. I
believe it would be in the benefit of the Java language for you
to add a feature which would allow the urls to timeout after a
given amount of time (be it longer or shorter).
I think the two best ways to approach this are:
(1) Allow the user to specify a timeout time (sounds funny) when opening the
connection.
ex. openConnection(int milliseconds) would be a method in
the URL class (and possibly the URLConnection class).
(2) Allow the user to set a specific timeout time for the URL
connection itself. Therefor any other redirects or change of
urls will already have the last timeout time to wait.
ex. setTimeout(int milliseconds) would be a new method in
the URLConnection class.
(Review ID: 52703)
======================================================================
- duplicates
-
JDK-4700777 HTTP client: Connect and read timeouts
-
- Resolved
-