• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hoe to get Socket Time Out  RSS feed

 
suneel kota
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am using java.net.URL in my program, i am calling a web service with this URL.. But i need to get the Socket time out if service is not available. How can it be done..

My requirement is when ever service is not available for 10 seconds i need to call an error page.

please suggest me..

Regards
SuneelKota
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.net.URLConnection, which you can create from URL, has several methods for managing timeout values.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!