URLConnection.getInputStream() hangs in Vista, Linux
843790Nov 6 2008 — edited Nov 6 2008I'm reading the output from a servlet using an URLConnection input stream, and the exact same code is acting differently based on the operating system. It always works in Windows XP, but it is hanging in Vista (Home Premium) and Linux (Ubuntu). Here is the URL that is serving the input data:
http://72.175.233.174/SOSWeb/SOSWebRemote?action=load-repository&tech=ALEE&date=20081106&version=05.00.00&device=GX280&lcf=O
and here is the code:
HttpURLConnection urlConn = (HttpURLConnection)url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String inLine;
while ((inLine = in.readLine()) != null)
{
... process input record
}
In Vista and Linux, the in.readLine() method returns about 10 records before it hangs. In XP, it reads all of the records without a problem.
Has anyone else run into a similar OS-based issue with URLConnection?
Thanks