Need to figure out how could one open a connection with a server and listen for constant changes from within client app in AS 3.0.
This is my first post here, so please bear with me for a few moments.
I'm trying to develop what is basically an online game that can be played by multiple players at once, from home, by installing the client i'm currently working on, to their machines. Now, i have no problem setting up the server, as it is set up to deliver XML when asked, example( gamenumber, maxplayers, currentplayers). I have chosen Adobe Air for client development. When the client is opened on a pc, it connects with the server and retrieves the XML example above, which then is shown in the main window. And here comes the question... Say i have 2 players, each at different locations registered on my website. HOW would the app communicate with the server, so that when player1 selects and opens a game from the app, and player2 joins that game, the client on player1's pc gets updated automatically... furthermore, once the game starts, and player1 takes some action in the game (pushes some button), player2 sees that. I know i can use timers, or pollintervals, for example to make the client, request a game status from the server every "n" seconds, but i am looking for a more liquid solution. For example, making the app listen constantly to the server for changes. Something like (could be a stupid ideea) implementing node.js in the app. Polling and timing works fine when it comes to a limited number of conections and data size, but if you have thousands or more, you either need a server farm, or another solution. I dont think that i will have thousands of connections, but as i develop the app, i realize that the data it needs to pull from the server increases with each new idea i have. SO... any ideas? I'd really rather not have to switch from Adobe Air to something else, but i'm open to suggestions.