-1

im planning to build flash multilayer server ( in c++ or java ) im not coming from the flash area . But from what im reading flash does support sockets , BUT this is not my case i need to be able to support browser flash games so it leaves me with port 80 with http .but how can i implement good communication architecture with http ( rest ? ) that the flash player supports Thanks

user63898
  • 29,839
  • 85
  • 272
  • 514

2 Answers2

3

Flash, even from within a browser, does support Socket connections, using the Socket class (in AS3) or the XMLSocket class (AS2/AS3).

But everything depends on what you're planning to do with the application, and how the networking is going to be used. For a multiplayer game, you'd probably need a push-pull network layer (where both the client and the server can send data to each others at any time). A Socket can do that.

Using HTTP would need your client to request data repeatedly to your server, which can be a burden both for maintaining a server-side context (you can't tell when a client is disconnected, and there's a lot of spoofing security issues related to this technique), and for performances, especially if your game is designed to be played in real time.

There is a framework for making AS3/Flex application communicate with a Java server, developed by Adobe : BlazeDS.

Hope this helps.

Tyn
  • 2,184
  • 1
  • 13
  • 20
  • one thing i dont understand is there any way not to use http when im working with browser clients – user63898 Feb 21 '09 at 18:01
  • Both the Socket and XMLSocket classes use TCP and not HTTP. Socket is better if you're writing in AS3. – Eliram Feb 22 '09 at 19:34
0

If you use the Socket or XMLSocket class, make sure your server has a security policy file available. Check this SO question/answer for more info.

Community
  • 1
  • 1
zooropa
  • 3,929
  • 8
  • 39
  • 61