- Home /
Some questions about unity app's tcp connection state in Android sleep mode
I'm develop a simply app for detecting the tcp connection state in Android sleep mode. After testing it , I had found that tcp connection will always keep-alive even in Android sleep mode.
The test procedure simply like below:
start the app and connect to server.The app will send a msg to server every 2 seconds.
do nothing and let the android device go to sleep naturally.
Wait for a long time(1 hour). During this stage , I can find that the connection is always keep-alive though app didn't send the message.
Wake up the device.And I found the app continue to send message to server.And server also receive it.
I used to think that tcp connection would disconnect when android device in sleep mode,but not this time. Didnt' I do something wrong?