views:

586

answers:

4

To create a client-server GAME applications in Flash, which would be more practical to use and faster in terms of client-server data exchange:

a. web services (flash / flex the client and PHP the server)

or

b. socket connection (flash / flex the client and C / C + + the server)

Any help is welcome. Thanks.

+4  A: 

That depends entirely on what data you are sending back an forth. If the flash/flex site is just a replacement of a dynamic HTML/PHP site, then use a web service. But if you want real time content (chat, pushing data from the server, etc) then you should go with sockets.

Marius
The application will be a game.
Emanuel
Then it depends on the type of game. A turnbased game can use a service, but a real time game needs sockets.
Marius
A: 

Of course a C program would be much faster than any PHP programm since PHP is live-interpreted by an C programm with the need of processing PHP statements.

neo
A: 

i'd like to point out haXe for the server side, targeting neko ... neko isn't C, but it's sufficiently fast ...

also, haXe remoting makes communication very easy, since haXe can compile to SWF ... personally, I also consider haXe a better language than AS3, but that's a matter of tast, so I'll leave it up to you to decide ... ;)

greetz

back2dos

back2dos
A: 

For performance you would use sockets. There is an off the shelf server for flash games called SmartFox server SmartFoxServer.com You could also code your own back end but then you need to deal with security issues which arise when the flash runtime needs to check cross domain permissions. e.g. need need to respond to <policy-file-request/> from flash before it will accept anything from you.

PeanutPower