简体   繁体   中英

Realtime communication for smart phones on 2G/3G

I am trying to create a simple drawing game like DrawSomething. The problem here is not the game itself but the communication. How to distribute the coordinates to the other smartphone (android + iOS) clients?

2G/3G: -generally does not support peer-to-peer connection. -UDP packets are blocked -Fragmented connection, ie. a client moves all the time and switches cellular stations, makes it impossible to maintain a single connection between client and server or client and client.

Obviously we could use POLLING at regular intervals. A central server would be required, but polling is inefficient for real time communication. To somewhat resemble realtimeness you would have to poll every 100 ms, with 100 client this could overload the server.

So the question is how do we do realtime communication for smartphones on mobile network?

Well what you would want to do is store all your infomation on a server, not do any Peer2Peer communication at all. Have when the information is saved on the server(turn is done) have the server send a c2dm message to the other player informing them of the new turn. If C2DM is not sufficient you can implement your own p2p networking using XMPP which is what C2DM is based on, but i would not recommended doing this, C2DM should be what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM