I created a simple chat server that is controlled by client polling. Clients send data requests every few seconds and receive any new messages, as well as information about whether everyone is connected to them.
Since the client runs on a mobile platform (iPhone), I was looking for ways to get rid of the survey, which quickly drains the battery. I read that it is possible to support an undefined http connection, but did not understand how to use this technique in practice. I am also wondering if such connections are stable enough for use in mobile setup.
The ideal scenario would be that the server sends data only to clients when an event has occurred that affects them (for example, a peer message or a failure).
Can I try to do this via http, or do I need to write my own tcp protocol? How difficult it would be to configure xmpp to my need (my chat server has some specialized functions that I should have easily implemented).
source share