Android: Socket goes in zombie state after keeping device in idle state for long time
<p>I am developing an app, in which I have maintained a infinite socket connection with server. It works pretty well all the time except when device stays in idle mode for longer time say 30 mins or so. After 30 mins if I bring device to wake state, and try to contact to server thro' my app it doesn't throw any exception. Which shows me that my socket connection is in still live state. But when I check at the server end same data is not received here. So I am not able to understand that is there is a known issue on android side or if I am doing anything wrong here. Below is the code piece I am using to setup the socket.</p>

<pre><code>Socket socket = new Socket(url, port);

                String request = "some request";
                outputStream = socket.getOutputStream();
                outputStream.write(request.getBytes());
                outputStream.flush();

                InputStream is = socket.getInputStream();

                while (true) {
                    StringBuffer sb = new StringBuffer();
                    int ch = is.read();
                    while (ch != -1) {
                            sb.append((char) ch);
                            ch = is.read();
                        }
            }
</code></pre>

<p>Thanks in advanced
GeekoDroid</p>
