Hi everyone,
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setConnectTimeout(12000);
conn.setReadTimeout(12000);
conn.connect();
int resp = conn.getResponseCode();
I'm performing this on a large set of URLs, all of which have passed validation prior to this code segment. After I get the response code I perform actions based on the return, but they're not pertinent to the question.
The problem is, I have a few pages in here like www.totalhealthminnesota.com and www.tzarglobal.com that are blank pages, they have empty headers and an empty body. The connection establishes fine but whenever I try to pull any information from the website, it hangs indefinitely at getResponseCode(). It doesn't throw any errors or do anything visibly unnatural, it just doesn't do anything at all. As you can see I've set the read timeout and it's not helping at all.
Can anyone explain why this is happening, and maybe offer any advice as to how to fix it?
Thanks in advance.
Edited by: Baelwulf on Jun 9, 2009 5:36 AM