File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

Timeout

 
Amit G Piplani
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
Can anyone tell me how to set timeout for java.net.HttpURLConnection?

Amit
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question in multiple forums. We all read several forums so you are not increasing your audience. You also may be wasting the communities time as we answer the same thing in multiple places.
 
Fahd Shariff
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
If you are using J2SE 5.0 then you can call the method setConnectTimeout. Otherwise you will have to start a new Thread which keeps track of how much time has elapsed since you tried to open the connection.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic