Guys Thank, genuinely, for the responses, I've learned how I *could* set a timeout, which I didn't know before. However, what I'm actually trying to get to the bottom of is what timeout could be in play *without* me setting it. As I said, the connection is already timing out and I don't want it to. Basically, I can hit the URL in question in a browser and, after a few second, get a response. When that piece of code hits the same URL, the Read timeout exception is thrown. So, it seems to me that the code isn't waiting long enough for the response to arrive, so something seems to be governing how long it waits. As we've established, it's not something that I've done in the code, so what is the timeout based on? Shouldn't the socket wait indefinitely for a response if nothing set a finite timeout length?
This is code in an already release product so if I can track down an environment setting that's governing the timeout then I can just adjust that setting for the one customer with the problem rather than having to patch the code and release it to everyone. On 12 February 2010 15:57, Christopher Schultz <ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Chuck, > > On 2/12/2010 10:46 AM, Caldarale, Charles R wrote: >>> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >>> Subject: Re: What governs a URL connection timeout? >>> >>> It's possible that (the other) Chris is using a library >> >> The OP already posted the code of interest > > Duh. That's what I get for not reading every word of the OP. > >> Just replace: >> >> InputStream t_inputStream = t_url.openStream(); >> >> with >> >> URLConnection t_connection = t_url.openConnection(); >> t_connection.setReadTimeout(desiredValue); >> InputStream t_inputStrem = t_connection.getInputStream(); > > +1 > > Or, setConnectTimeout() which answers the OP's actual question, but > wouldn't end up solving his problem. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkt1el4ACgkQ9CaO5/Lv0PBcZwCgs0DDTQpjlCzo7QJ+kP84Obo0 > E9UAoIOk6Bm5CLCNWBb1g/jXy9p8hDZ8 > =6wCb > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- Chris Mannion iCasework and LocalAlert implementation team 0208 144 4416 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org