| Reply | « Previous Thread | Next Thread » |
|
Hi.First of all thanks for helping me out with my previous questions. I have been able to handle all previous issues with your help. I was going through the pdf that contains info about polling.But the info just describes the type of pollings.Can you please tell me how exactly does polling take place? i mean, do the clients playin the game send requests to the server to make a move or the server or the gateway decide who will make the next move n send this info to clients? i jus need a theoratical overview.No need for gettin into the code.
Thanks n Regards Abhi Sam |
|
Hi Abhi Sam,
Very sorry about not posting a reply earlier. As explained, our pimary developer support is away currently and so our response has not been as quick as it normally is. In answer to your question, SNAP Mobile clients poll the server either automatically through the use of the SNAP Event Listner or manually via retrieveAllEvents. Please see the Hello World example app in the 1.1 SNAP Mobile SDK for an example. We *strongly* recommend the use of the event listner mechanism. Using the manual retrieveAllEvents is only recommended in certain circumstances such as on devices which can only use HTTP and can only make 1 open connection at a given time. Since most devices can use direct TCP sockets now, the use of this interface is becoming depricated. So what does polling do? Well, the SNAP Mobile API is basically done through a HTTP request / response mechanism. Every time a client wants to send something to another player, gameroom, friend, etc... they must send a command. OK. Basic. So what is polling? Polling is used so a client can get the asynchronous info other players or the servers send them. e.g. friend/buddy chat messages, game data, enter/leave gameroom messages, etc... Asyncronous events are sent to a client from the respective Online Service (e.g. SNAP or IMPS). The asynchronous data is sent to the clients Virtual SNAP Mobile Client in the gateway layer of the architecture. The polling mechanism allows a client to connect to the Virtual SNAP Mobile client on the gateway to see if there is any asynchronous data waiting for them. If the client is using the defualt wait-poll mechanism in the event listner thread, the poll request will remain open to the server until either 1 event has been received or N seconds (currently 20 by defaul) has passed, which ever comes first. This allows the fastest return to the client of new events. The gateway does not get involved in any game logic except for matchmaking. All such issues as who goes when, why, are left to the game. My best advice is to invoke the snapEventListner immediatly after login by your application. Remember to remove it just *before* you logout. Does this answer your question? If not, I will be checking the boards later today. Thanks for your understanding, Matt Tech Lead & SDK Manager SNAP Mobile |
|
Well thanks a lot sir.Your answer pertaining to polling sounded good. Now i understood what is polling. But the question that still remains is that if polling is for clients to find out any state change,etc in the server or the other clients then still, how does a client find out in a game that it is my turn next? If the communication is asynchronous then wont it happen that all client players will try sendin data at the same time, without knowin if it is their turn or not and assuming that it is their turn.Thats what i really need some help on.
|
|
This is in continuation to my last post.Is The Ok command that you talked of for sending the data like a token ring approach? i mean that is there a token that is to be grasped by the client using OK command and then only will he send the data??
Regards Abhi Sam |
|
Hi,
In your last set of posts you asked: "how does a client find out in a game that it is my turn next?" This question is one of basic game logic. We do not provide game or programming support, we only support the SNAP Mobile technology. SNAP Mobile does not direct game play. It provides a transport platform upon which games can be played online. Issues such as turn management are left to the developer. In addition, I am not sure of what you mean by a token in this regard. The gameplay functionality of SNAP Mobile acts as a direct packet router, routing game and chat packets to some or all users within a specified gameroom or lobby. There is no token system to indicate who goes when and how. Each client acts independently and within the structure of the game being played. A client can/will receive game packets from the server using the polling mechaniscm. A client can/will receive status messages from other clients and from the system using the polling mechanism. It is up to the game logic to determine what to do with these messages. Cheers, Matt |
|
Ok sir.thanks a lot.You really gave some relevant info.
Regards Abhi |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Nokia 9500: browsing issue ? cache issuse ? | coberle | General Browsing | 0 | 2005-10-12 17:31 |
| DATA SYNC ISSUE - Even in single threaded Symbian Apps | nitinkumar | General Symbian C++ | 0 | 2005-02-25 11:30 |
| Security code issue for 6230 | kababoom | General Discussion | 1 | 2004-08-19 06:39 |
| 6220/6820 WV Chat client not polling | bogdano | Smart Messaging | 2 | 2004-05-26 10:22 |
| Solved: USB IRDA issue with 3360 and 6360 for Win98 & Win2K | Vicman | PC Suite API and PC Connectivity SDK | 1 | 2003-05-07 06:34 |