• 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

URLConnection Timeouts

 
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a problem with my URLConnection hanging on Windows (Java 8). From my research there seems to be a known issue with 'URLConnection.SetConnectTimeout' but it appears be be only in versions preceeding 8. What is less clear is how to get some kind of timeout to work. I even tried 'System.setProperty("sun.net.client.defaultConnectTimeout", "10000")'. So what is the correct way to set a connection timeout that really works? TIA.
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, I think I got it. It seems that for reliability both 'SetConnectTimeout' and 'SetReadTimeout' need to be set. Sorry for the bother.
 
reply
    Bookmark Topic Watch Topic
  • New Topic