android http get request infinite loop
<p>For some reason when I make a GET request, it seems to go into an infinite loop. I thought it was my web app having an issue, but after trying google.com, the same results occur.</p>

<pre><code>    try {
        URL url = new URL("http://google.com");

        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setReadTimeout(10000 /* milliseconds */);
        con.setConnectTimeout(15000 /* milliseconds */);
        con.setRequestMethod("GET");
        con.setDoInput(true);
        con.connect();

        InputStream is = con.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));

        for (String line = reader.readLine(); line != null;) {
            System.out.println(line);
        }
        reader.close();

    } catch (ClientProtocolException e) {
        System.out.println("Client Exception " + e.getMessage());
    } catch(IOException e) {
        e.printStackTrace();
        System.out.println("IOException " + e.getMessage());
    }
</code></pre>

<p>this code never passes the for loop. It just continues printing. Anyone see what's wrong?</p>
