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 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 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_C RScsClientBase ( ) [protected]

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

Member Functions Documentation

CallSessionFunction(TInt)

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.

Parameters

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

CallSessionFunction(TInt, const TIpcArgs &)

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.

Parameters

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

CallSessionFunction(TInt, const TIpcArgs &, TRequestStatus &)

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.

Parameters

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.

CancelSessionFunction(TInt)

IMPORT_C void CancelSessionFunction ( TInt aFunction ) const [protected]

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

Parameters

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

Close()

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.

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

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.

Parameters

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.

ResetServerHeapFail()

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

SetServerHeapFail(TInt)

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

Parameters

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

ShutdownServer()

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

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 & aExeName Executable which hosts the server.
const TUidType & aFullExeUid The server executable's full UID. This is used to ensure the intended executable is started, and not another executable with the same name.