This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I need to know the feature of connectiontimeout setting for URLConnection. Can anyone provide concrete answer for my below questions:
1. When can we set connectiontimeout?
2. If I give some value in milliseconds for connectiontimeout, what will happen while connecting specific URL?
3. If I am unable to read my Inputstream after connection established, can connectiontimeout property take care of that particular connectivity?,else should we set property for readtimeout also?
Another option is setting the system properties: sun.net.client.defaultConnectTimeout and sun.net.client.defaultReadTimeout. I think that would work, but you probably have to set them as you start the JVM, i.e., with a -D parameter.
subject: URL connection connectiontimeout and readtimeout issues