×

Discussion Board

Results 1 to 6 of 6

Thread: Polling issue

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    31

    Thumbs up Polling issue

    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

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    25

    Re: Polling issue

    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

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    31

    Arrow Re: Polling issue

    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.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    31

    Arrow Re: Polling issue

    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

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    25

    Re: Polling issue

    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

  6. #6
    Registered User
    Join Date
    Jun 2006
    Posts
    31

    Thumbs up Re: Polling issue

    Ok sir.thanks a lot.You really gave some relevant info.
    Regards
    Abhi

Similar Threads

  1. Nokia 9500: browsing issue ? cache issuse ?
    By coberle in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2005-10-12, 16:31
  2. DATA SYNC ISSUE - Even in single threaded Symbian Apps
    By nitinkumar in forum Symbian C++
    Replies: 0
    Last Post: 2005-02-25, 10:30
  3. Security code issue for 6230
    By kababoom in forum General Development Questions
    Replies: 1
    Last Post: 2004-08-19, 05:39
  4. 6220/6820 WV Chat client not polling
    By bogdano in forum Smart Messaging
    Replies: 2
    Last Post: 2004-05-26, 09:22
  5. Solved: USB IRDA issue with 3360 and 6360 for Win98 & Win2K
    By Vicman in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-05-07, 05:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •