I'm making a multiplayer flash game where at a 'table' more than two players will be playing. Its turn based. Using zendAMF can the server response be made to wait till the player whose turn it is has made his move, so that it will appear to be real time?

I don't want to use polling since I read that it is not a very good practice. Instead can this method work? Lets say its player A's turn and the other players B,C,D are waiting. Their flash clients send a request to the server to get any updates. Instead of responding immediately can the server wait till player A has made his move and then send its response containing player A's move details to other players B,C,D?

Edit: Added image.

Found the name of this method. Its called Long polling. So can Long polling be done with PHP webserver running apache and using a flash client which sends the requests?

This is how the other players waiting players B,C,D are expected to be treated.

enter image description here

1

There are 1 best solutions below

0
On

Normally in something like this, you'd wait on PlayerA do make their turn before sending everybody the results. Put a timer on it though so that you're not waiting forever.

Something like: PlayerA's turn, PlayerA does something (validate, then notify PlayerB, PlayerC and PlayerD). PlayerB's turn, PlayerB does something (validate, then notify PlayerA, PlayerC and PlayerD). PlayerC's turn, PlayerC times out (5/10 seconds), do default action then notify all players. PlayerD's turn...