Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

URLConnection.getInputStream() hangs in Vista, Linux

843790Nov 6 2008 — edited Nov 6 2008
I'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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2008
Added on Nov 6 2008
2 comments
465 views