RScsClientBase Class Reference

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.

Inherits from

Public Member Functions
IMPORT_C voidClose()
IMPORT_C TIntResetServerHeapFail()
IMPORT_C TIntSetServerHeapFail(TInt)
IMPORT_C TIntShutdownServer()
Protected Member Functions
RScsClientBase()
IMPORT_C TIntCallSessionFunction(TInt)
IMPORT_C TIntCallSessionFunction(TInt, const TIpcArgs &)
IMPORT_C voidCallSessionFunction(TInt, const TIpcArgs &, TRequestStatus &)
IMPORT_C voidCancelSessionFunction(TInt)
IMPORT_C TIntConnect(const TDesC &, const TVersion &, const TDesC &, const TUidType &)
Private Member Functions
TInt StartServerProcess(const TDesC &, const TUidType &)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RScsClientBase()

IMPORT_CRScsClientBase()[protected]

This constructor is protected to ensure this class is not instantiated directly.

Member Functions Documentation

CallSessionFunction(TInt)

IMPORT_C TIntCallSessionFunction(TIntaFunction)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.

Parameters

TInt aFunctionFunction identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.

CallSessionFunction(TInt, const TIpcArgs &)

IMPORT_C TIntCallSessionFunction(TIntaFunction,
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.

Parameters

TInt aFunctionSession function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.
const TIpcArgs & aArgsStandard IPC arguments.

CallSessionFunction(TInt, const TIpcArgs &, TRequestStatus &)

IMPORT_C voidCallSessionFunction(TIntaFunction,
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.

Parameters

TInt aFunctionSession function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.
const TIpcArgs & aArgsStandard IPC arguments.
TRequestStatus & aStatusThis will be completed by the server when it has finished handling the function.

CancelSessionFunction(TInt)

IMPORT_C voidCancelSessionFunction(TIntaFunction)const [protected]

Cancel an outstanding session request. This has no effect if the request is not outstanding.

Parameters

TInt aFunctionImplementation function. This must be the same value that was supplied to CallSessionFunction.

Close()

IMPORT_C voidClose()

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.

Connect(const TDesC &, const TVersion &, const TDesC &, const TUidType &)

IMPORT_C TIntConnect(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.

Parameters

const TDesC & aSvrNameName of server to connect to.
const TVersion & aReqVerRequired server version.
const TDesC & aExeNameExecutable which hosts the server. This function will launch this executable if the server is not running.
const TUidType & aFullExeUidThe server executable's full UID. This ensures the intended executable is started, and not another executable with the same name.

ResetServerHeapFail()

IMPORT_C TIntResetServerHeapFail()

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

SetServerHeapFail(TInt)

IMPORT_C TIntSetServerHeapFail(TIntaRate)

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

Parameters

TInt aRateNumber of allocations after which allocation should fail on the server heap.

ShutdownServer()

IMPORT_C TIntShutdownServer()

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...

StartServerProcess(const TDesC &, const TUidType &)

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.

Pre-condition
This function should only be called by Connect(const TVersion&) if the server is not already running.

Parameters

const TDesC & aExeNameExecutable which hosts the server.
const TUidType & aFullExeUidThe server executable's full UID. This is used to ensure the intended executable is started, and not another executable with the same name.