Persistent UDP sessions on Android
- by Wedgeski
I have a client-server app which requires me to maintain a persistent session over UDP.
The goal is to maintain a path from the server to the mobile Android device no matter what route it has to the internet (WiFi or mobile network). This is achieved using a proprietary, well-tested session-management protocol over UDP.
I need the phone to be able to maintain, say, a five-minute keep-alive with the server at all times. Ideally I would like to do this without maintaining any wake-locks on the device. I don't want the screen to light up every time I send a UDP to the server, for example, and I don't want to have a damaging effect on battery usage.
Has anyone addressed this problem?