Forums Register Login

URLConnection not timing out correctly

+Pie Number of slices to send: Send
I want my url connection to timeout after a few seconds but it continues to try to connect past the timeout. Has anyone ever seen this before?

I.E.


Is there something going on here that I am missing?

Thanks
+Pie Number of slices to send: Send
What version of the JDK are you using?
+Pie Number of slices to send: Send
Just as a confirmation, I have the same problem with my Java 6u13. No matter if I change the timeout to 1s or 5s, after just over 2s the exception is thrown.
+Pie Number of slices to send: Send
I see from the Javadoc that non std implementations can ignore this setting and that you should try a getTimeout() after you set it to see the real time out value?
+Pie Number of slices to send: Send
I tried in 1.5 and 1.6 same problem.

I did try getConnectTimeout() just as the javadoc says and I can see the correct value (i.e. whatever I set it to). The problem still remains that it does not timeout properly. Any more ideas?

Thanks again.
+Pie Number of slices to send: Send
Can't think of anything else no, I can only assume the underlying resource is not playing ball so to speak .
+Pie Number of slices to send: Send
I'm going to move this to our sockets forum, perhaps somebody there can help you better.
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1284 times.
Similar Threads
read timeout not working after given period
Immediate read timeout
Timeout and retry issue with URLHTTPRequest
URL connection connectiontimeout and readtimeout issues
Http timeout java 1.4.2
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:11:56.