I am using a thread launched from android local Service,after I let my phone goes to sleep mode,then reuse it later after a while I get connection reset in my server side.
I am looking why it happens that connection reset,looking for this for a days ago.
I have the same problem, and the server also gets a RST when it send some ping packet to android phone after phone’s several minutes sleep.
I think the post below may answer some questions:
http://groups.google.com/group/android-developers/browse_thread/thread/8a611b2aeaa4d620
What network are you using (phone network or WIFI)?
My phone is connect via EDGE network.
I made the server send message every 6 minutes, and the server always get RST after the first 6 minutes, but 5 minutes will keep the connection alive. And I also tried to let the server sent message every 2 minutes (phone’s screen is off), the connection can keep alive for a long time (I tested for one hour and more).
Then I keep the phone’s screen on (it will not sleep) and tried again, but after 6 minutes the connection was killed again (server got RST), so it seems android sleep is not the cause of RST.
Based on my testings, I think my phone network vender is killing these long-time connections that idle at least 6 minutes, and send the RST to both phone and server.
So it may have nothing to do with phone sleep.
I havn’t tested on other networks, please tell me the results if you do.