If your mobile device does not allow you to make TCP connections and you are limited to HTTP requests, then you are looking at a “long polling”.
One HTTP POST request and the web server will wait as long as possible (before the timeout). If something arrives while the connection is idling, it can receive it directly, if something arrives between requests for a long poll, it is queued until the request appears.
If you can connect to TCP connections, just configure the connection and let it stay idle. I have icq and irc applications that essentially just sit there, waiting for the server to send something.
source
share