Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Nov 2006

    Implement callback in client/server architecture

    I use client/server architecture in my application to separate application UI from engine. However, when some events occur, engine need to pass the message back to UI. So in this client/server implementation, how can I implement the observer pattern to allow engine to callback to UI since UI and engine are in different process?


  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Wiltshire, UK

    Re: Implement callback in client/server architecture

    You will see theat RSessionBase has a number of overloads of SendReceive that take a TRequestStatus.

    Use an ActiveObject and its TRequestStatus to handle the callbacks. Any data can be transferred back through arguments in the SendRecieve call.

    There is an example of this on WhoShavesTheBarber.com - Chaper 12 sample code.

    I would recommend you thoughly read this book to see how to implement cross process asynchronous calls.

    Basically on the client you create an active object.
    This object's TRequestStatus is then passed in the SendRecieve call to the server.

    The server stores the RMessage and when the condition that would cause the call back to fire, it calls the Complete method in the RMessage and this will trigger the active object on the client.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Oslo, Norway

    Re: Implement callback in client/server architecture

    Callbacks are realized as active objects on Symbian, using a R[Sub]SessionBase::SendReceive(...,TRequestStatus). Sometimes the developer has to implement the Active Object (in case of using R-classes as RTimer, RSocket, etc.), sometimes the AO is implemented on Symbian-side, and the developer implements M-interfaces declaring callback methods (for example: CMda...Player/Utility classes expect you to implement an M...Observer/Callback interface).

Similar Threads

  1. Replies: 9
    Last Post: 2008-01-03, 17:28
  2. Callback card midlet
    By monkie in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-19, 22:43
  3. Traditional Symbian view architecture
    By joelshaf in forum Symbian
    Replies: 4
    Last Post: 2007-03-15, 14:38
  4. Callback function not being invoked at all
    By koh888 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2007-01-31, 12:03
  5. Python C++ Extension with Callback crashing
    By diggerdeep in forum Symbian
    Replies: 2
    Last Post: 2005-11-10, 16:33

Posting Permissions

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