Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am trying to write a massive online multiplayer client for a poker site, where one user can be on a Flash client and the other on say an iOS client (iPhone / iPad), and would like to know how can interaction between two users be visible on both clients.

What would be better to use?

  • Should I use MSMQ?
  • AJAX?
  • Something other?

I need the messaging layer (client interaction messages) to scale up to 100K+ online users to begin with.

In other words; What scalable technology can I use to make game interactions between online users visible to all game participants?

share|improve this question

closed as not a real question by gnat, Martijn Pieters, GlenH7, ChrisF Jan 19 '13 at 12:59

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

How much development experience do you have? Will the system need to be secure because money is involved, or is it just for fun? Can you deploy gambling applications to the iPhone, i'm not sure? –  Chris Barry Jun 25 '11 at 0:14
This sounds like a test question in my software engineering class. I think the lack of responses might be due to how hard this question is to answer. –  Casey Patton Jun 25 '11 at 19:36
Chris, it's funny-money poker with no real cash play. But it should be secure none-the-less. I have some general web-development background with PHP, ASP.NET / C#, XML, SQL, JavaScript, etc. Nothing solid on an enterprise level.. Just enough to build an online shopping-cart :). However, for the last 5 years, I've traded web-development for Enterprise Data Management / Architecture. I specialize in SQL Server architecture, performance tuning and scaling. So in my mind, all game data is already being modeled and toyed with.. –  Eyal Jun 30 '11 at 19:34

4 Answers 4

Since both Flash and iOS support raw sockets, I'd just use a raw protocol layered on top of TCP. Define a simple message format with messages for things like "join game", "place bet", "received card", "need your choice of cards to turn in", "other players showed their hands", and so on.

Code each game as a state machine. Events flow into the state machine when users make decisions. Events flow out of the state machine to users as the games are played or as timers fire.

share|improve this answer

What would be better to use?

Should I use MSMQ? AJAX? Something other?

First of all, it's important to understand that MSMQ and AJAX aren't mutually exclusive. They solve very different problems.

AJAX would improve the user experience for people connecting to your online poker game via a web client.

But as you've already implied, the principal challenge in implementing a massive multi-player poker game is the messaging infrastructure which includes the message bus and the ways by which your clients will send and receive messages.

So yes, MSMQ would be a good choice for the message bus (although it's by no means the only option). But as I said, in addition to the actual message bus, you need to think deeply about the client-side code on each platform which will send and receive messages. For instance, will you poll for messages? What should you do if a client has difficulty receiving messages? Etc.

As you can tell, the implementation of a messaging infrastructure is a complicated topic. Specific implementation details will vary by project so it's important to understand appropriate design patterns and heuristics.

share|improve this answer

If you're ready to learn a lot of new stuff you could draw some inspiration from this HN post:


Also you might add Protocol Buffers to the list:


share|improve this answer
would you mind expanding a bit on what each of these resources have and why do you recommend these as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Jan 19 '13 at 6:19

you are trying to write a massive scalable online poker game. first you need to consider sort of distributed environment architecture. you can't install one server to run such service. you should not use a raw tcp protocol because in a tcp session you need to maintain a connection with one server all the time and this is hard to implement in a dist env. the best way would be SOAP-like protocol and stateless sessions but this will cause another problem: authentication and validation of user's requests in a stateless environment. and don't forget that flash is not secure and data could be tampered easily so you must have secure coding. don't wait for a simple answer, it could take months to figure out how to implement the solution. hope this will help you and good luck.

share|improve this answer

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