• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Http timeout java 1.4.2

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible to make a timeout in the following code, or do i have to make a thread for timeouts on a http connection ???
Im using java 1.4.2
URL url = new URL(ipadresse);
URLConnection urlConnection = url.openConnection();
urlConnection.setDoOutput(true);
Frank Jacobsen
SCJP
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran into the same problem and found no direct solution using core Java classes. I ended up using the Jakarta Commons HttpClient API (http://jakarta.apache.org/commons/httpclient), which does handle timeout very well. If you are trying to post data to a URL or any other HTTP operations, it is the way to go.
Hope this helps.
reply
    Bookmark Topic Watch Topic
  • New Topic