×
Namespaces

Variants
Actions

Responsibilities of Asynchronous Service Provider in Active Objects

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: wantrahul (25 Feb 2010)
Last edited: hamishwillee (26 Jul 2012)

Asynchronous Service Provider provides asynchronous services using request functions and cancel functions. In general, Symbian Active Objects encapsulate Asynchronous Service Providers and their request, cancel functions and the function which handles completion of requests.

An asynchronous service provider must interact in the following ways with its clients:

  • Before initiating a request, a request function must set the value of the passed TRequestStatus to KRequestPending, which indicates that a request has been issued but not completed.
  • Requests must be completed by signaling the requesting thread’s request semaphore by calling RThread::RequestComplete() with the TRequestStatus as the first parameter and the completion code as the second parameter (which is placed in the TRequestStatus).
  • There must be a cancel function which can cancel an outstanding request. In some cases, calling the cancel function does not cancel the operation because the request is already complete. In all cases, the request must be complete before the return of the Cancel() function.
  • If an asynchronous request is made, it must complete precisely once, whether normally, abnormally, or through cancellation.
  • A TRequestStatus code of KErrCancel often indicates completion through cancellation.
This page was last modified on 26 July 2012, at 08:03.
49 page views in the last 30 days.
×