I have a Flash application that exchanges data with php scripts. Problem is, I can SEND updates, not receive.
Example:
- user drags an object to another area
- flash sends this action to a php script using URLLoader
- the server acknowledges the action and returns an “ok” message with the same URLLoader
Now if the server wants to send a message, like “there’s an update available”, or “your friend has logged in”, how is this supposed to happen?
I believe an always-open socket is out of question, because the server will have to handle too many users at once and the section might be indefinitely long. I’m not so sure about the Flash client constantly pinging the server.
So, what’s the best way to send data from PHP to Flash asynchronously?