Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am working on card games for mobile devices. For multiplayer I will be communicating through a central server. For the purpose I sorted out three options:

  1. HTTP polling
  2. TCP
  3. Websocket (client libraries are not good, so will not use it)

HTTP polling is simple, but I fear it will introduce much more delay and too many HTTP calls. TCP introduces other complications.

So my question is: Is HTTP polling appropriate for a card game? Will the HTTP overhead be too much? How much interval should I keep for polling?

Can you give a sample game based on HTTP polling?

share|improve this question
    
its turn based... anything will do. in poker games users have like 30 seconds time to decide, so polling after 5 seconds woulnd be even noticable. But you can use socket.io with nodejs and switch from websockets to polling as you wish. –  Kikaimaru Jan 8 '13 at 12:07
    
Regarding socket.io: Is there any option for ios and android.. What about c,c++ –  user739711 Jan 8 '13 at 12:14
    
This seems like a "what technology to use" question, which is off-topic as per the FAQ. Maybe if the question was rephrased as "Under what conditions should one prefer using TCP over HTTP polling" or something, it'd be more appropriate? –  Trevor Powell Jan 8 '13 at 20:23

1 Answer 1

When you can use TCP sockets, you should use them. Everything else you mentioned are just protocols on top of TCP anyway which add boilerplate which is unlikely to add anything in your particular use-case. I don't know what "other complications" you are referring to, but when you have problems, we at stackoverflow.com will certainly be able to help you.

When you want to make your application HTML-based (best option for true portability), you can't use pure TCP sockets. But there is socket.io, which is able to pick the most socket-like transport mechanism available to the browser and use it through a common interface.

share|improve this answer

Your Answer

 
discard

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.