• Post Reply Bookmark Topic Watch Topic
  • New Topic

URLConnection time constraint  RSS feed

 
Atul Samnerkar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am retriving some data based on URL. This URL internally acts as webservice client to fetch data from other location and returns back the data.
There are chances that the webservice will be down which will directly impact in fetching the data.
What percaution should be taken to avoid such scenario? Is there any way we can add some time constraint or make the call asynchronous?



Your help is highly appreciated.
Thanks in advance.

Regards,
Atul Samnerkar
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you missed URLConnection's setConnectTimeout and setReadTimeout methods.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!