I'd like to set a timeout on an HTTP connection but there doesn't appear to be any way to do this cleanly. Java 1.4 introduced timeouts on Sockets, but HttpUrlConnection doesn't appear to give access to the underlying socket. I know there's a third party HttpClient that supports timeouts (and an unsupported system propery) but I'd prefer a core java solution. Any ideas? Cheers, Jeremy.
Joined: Feb 21, 2002
Decided to go for a combination of platform specific secret hidden sun property for some VMs together with a slow third party solution for remaining VMs. Doesn't seem very satisfactory though. Apparently the lack of timeout is being addressed in 1.5. We'll see.