• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to check if HttpURLConnection exists using the object, which was open before

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am looking for a solution for this problem eagerly

I am creating a HttpURLConnection to a URL and getting feed from it after 'SUCCESS' response code. The feed I am using has a chance to go off, when there is some issue. Is there any way to identify if the connection is still active using the same connection object I created. I tried getting response code of the connection, which is returning 200-OK always, even if the stream/feed has gone off. Could any one help me out in this...

I have given the snippet below, Please let me know if I need to furnish any more details




Even the readLine() method could able to return a line(after the connection gone off), as it is using buffer, so I couldn't able to come out and reconnect.

Thanks in advance!

Regards
Manoj
 
What are you doing in my house? Get 'em tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic