Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting connection timeout in URL class

Status
Not open for further replies.

developerinlondon

Programmer
Jan 11, 2003
196
GB
i am trying to change the default connection timeout in a URLConnection so that it waits a bit longer. But I seem to be getting connection timeout errors in shorter times.
code :
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setConnectTimeout(300000);

in my logs I get a timeout error in about 21000ms.

any ideas?
 
ok it seems the 21000ms is the maximum its waiting... is there any other settings i need to look at?
 
Did you try a getConnectTimeout() to check the value?
There's also another timeout parameter called readTimeout.

Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top