class RScsClientBase : public RSessionBase |
Provides functionality to connect to the server, starting the server process if necessary. This class cannot be used directly - the SCS implementor must define a subclass.
Public Member Functions | |
---|---|
IMPORT_C void | Close () |
IMPORT_C TInt | ResetServerHeapFail () |
IMPORT_C TInt | SetServerHeapFail ( TInt ) |
IMPORT_C TInt | ShutdownServer () |
Protected Member Functions | |
---|---|
RScsClientBase () | |
IMPORT_C TInt | CallSessionFunction ( TInt ) |
IMPORT_C TInt | CallSessionFunction ( TInt , const TIpcArgs &) |
IMPORT_C void | CallSessionFunction ( TInt , const TIpcArgs &, TRequestStatus &) |
IMPORT_C void | CancelSessionFunction ( TInt ) |
IMPORT_C TInt | Connect (const TDesC &, const TVersion &, const TDesC &, const TUidType &) |
Private Member Functions | |
---|---|
TInt | StartServerProcess (const TDesC &, const TUidType &) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
IMPORT_C | RScsClientBase | ( | ) | [protected] |
This constructor is protected to ensure this class is not instantiated directly.
IMPORT_C TInt | CallSessionFunction | ( | TInt | aFunction | ) | const [protected] |
Send a command to the corresponding server-side session. The subclass uses this function instead of directly calling RSubSessionBase::SendReceive because it adds the SCS code which marks this as an ordinary session call.
TInt aFunction | Function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands. |
IMPORT_C TInt | CallSessionFunction | ( | TInt | aFunction, |
const TIpcArgs & | aArgs | |||
) | const [protected] |
Send a command to the corresponding server-side session. The subclass uses this function instead of directly calling RSubSessionBase::SendReceive because it adds the SCS code which marks this as an ordinary session call.
IMPORT_C void | CallSessionFunction | ( | TInt | aFunction, |
const TIpcArgs & | aArgs, | |||
TRequestStatus & | aStatus | |||
) | const [protected] |
Send the supplied function identifier and arguments to the server-side session. The subclass uses this function instead of directly calling RSubSessionBase::SendReceive because it adds the SCS code which marks this as an ordinary session call.
TInt aFunction | Session function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands. |
const TIpcArgs & aArgs | Standard IPC arguments. |
TRequestStatus & aStatus | This will be completed by the server when it has finished handling the function. |
IMPORT_C void | CancelSessionFunction | ( | TInt | aFunction | ) | const [protected] |
Cancel an outstanding session request. This has no effect if the request is not outstanding.
TInt aFunction | Implementation function. This must be the same value that was supplied to CallSessionFunction. |
IMPORT_C void | Close | ( | ) |
This method should be used in preference to RScsSessionBase::Close because it sends a message to cancel any outstanding requests on the session or its subsessions.
IMPORT_C TInt | Connect | ( | const TDesC & | aSvrName, |
const TVersion & | aReqVer, | |||
const TDesC & | aExeName, | |||
const TUidType & | aFullExeUid | |||
) | [protected] |
Attempt to connect to the named server. If the server is not available then attempt to start its hosting process.
const TDesC & aSvrName | Name of server to connect to. |
const TVersion & aReqVer | Required server version. |
const TDesC & aExeName | Executable which hosts the server. This function will launch this executable if the server is not running. |
const TUidType & aFullExeUid | The server executable's full UID. This ensures the intended executable is started, and not another executable with the same name. |
IMPORT_C TInt | ResetServerHeapFail | ( | ) |
Finish marking the server heap and reset the failure rate. This should match a previous call to SetServerHeapFail.
If there is a heap imbalance, then the server will be panicked.
This function is empty in release builds.
SetServerHeapFail __UHEAP_MARKEND __UHEAP_RESET
IMPORT_C TInt | SetServerHeapFail | ( | TInt | aRate | ) |
Start marking the server heap and set a deterministic fail rate. This should matched with a call to EndServerHeapFail.
This function is empty in release builds.
EndServerHeapFail __UHEAP_MARK __UHEAP_SETFAIL
TInt aRate | Number of allocations after which allocation should fail on the server heap. |
IMPORT_C TInt | ShutdownServer | ( | ) |
DEBUG USE ONLY - Tells the server to shutdown down ASAP, and block until it has done so. This also closes the current session.
If the server is not configured to use a inactivity shutdown timer, this will fail with KErrNotSupported.
nb. You may still need to call the Close function of a derived class to ensure it gets to cleanup...
TInt | StartServerProcess | ( | const TDesC & | aExeName, |
const TUidType & | aFullExeUid | |||
) | [private] |
This function is defined for the convenience of subclasses which need to start a server process before they can connect to the server.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.