Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With flash based games (or flex), is it a pull or request/response system or is it possible for the game server (say java based) to actually push out to its remote flash clients?

share|improve this question
It depends on your method of communication. Are you using remoting/web requests or sockets? – Luis Estrada Feb 28 '12 at 22:56

There are basically two different ways you can achieve "pushed" updates through flash. Using the Socket class is the most straightforward and gives you the most control. At this level, you can either exchange XML data or just read and write raw bytes. The only real downside is that some people might have trouble connecting depending on things like routers, firewalls and security software. There's also a tricky little bit about setting up a security policy server, which isn't made immediately obvious in the Socket API documentation.

The second method is to use a long polling HTTP request via the URLStream class. Essentially the client will make a regular HTTP request that stays open, then the server will push data down that connection as it becomes available, and the URLStream class allows you to process the data as it comes in. If the client needs to send any updates to the server, it can do so through regular HTTP requests, the tricky part is to ensure that something in that request reliably identifies the client so the server can apply the update properly (and securely).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.