I'm building an app in which the client (PhoneGap) is waiting for some event to be triggered from another client !
So of course the schema would be: Client1 one send a message (name, message and target(client2)) - Server - Client 2 receive the message (from client1, message, client1.name) this can happen every second or every hour. No rules. It can also happen only once or never ..
I've a lot of examples about long polling like here: How do I implement basic "Long Polling"?
I know it's bad to use it with Apache. So I'm wondering if in this case I should use setInterval instead?
Should I set up an interval to ask the server to check the DB if I previously recorded any message from a client to another one and deliver it ? or is this a bad way to go?
Please advise, thanks :)