wood burning stoves*
The moose likes Java in General and the fly likes How to check if HttpURLConnection exists using the object, which was open before Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to check if HttpURLConnection exists using the object, which was open before" Watch "How to check if HttpURLConnection exists using the object, which was open before" New topic
Author

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

Mano Krrish
Greenhorn

Joined: Sep 10, 2010
Posts: 13
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
 
Consider Paul's rocket mass heater.
 
subject: How to check if HttpURLConnection exists using the object, which was open before