Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Request handling

The central purpose of the Message Server is to accept and carry out requests from clients, which include message client applications, Client-side MTMs, and User Interface MTMs. Typical requests include changing the structure/contents of the local folders, sending and receiving of messages through different services, changing the contents/structure of remote mailboxes, and MTM-specific requests.

Some asynchronous requests, such as sending a fax, can take considerable time to complete. In order to be responsive, message client applications may well need to change the context (the message entry being operated on by an instance of CMsvEntry) while a request is being processed. To allow this to happen, the request functions return an active object, called an operation object, with base class CMsvOperation, that is then responsible for the request. The CMsvEntry object has no further interest in that request and is free to change context. A client then uses the operation active object in the standard ways, such as waiting for request completion, and cancelling the request. Additionally, the operation class supports a progress function, which returns an MTM-specific progress descriptor, containing, for example, the number of pages that have so far been sent. User Interface MTMs implement a function to display this progress information to the user. Once the client is signalled that the request has completed, it can check the final progress information, before deleting the operation object.

For each request that the Message Server receives, it creates an operation object of its own. This object checks to see if a Server-side MTM is required to carry out the request, and, if so, calls the server-side registry to create it. The operation object then calls the appropriate function on the MTM object, which carries out the request asynchronously. While this is happening, the Message Server may receive further requests requiring the same Server-side MTM. The Message Server queues such requests and passes them to the MTM object consecutively. More than one instance of a server MTM may exist if the operation is being called on a different service.