RScsClientBase Class Reference

#include <scs/scsclient.h>

Link against: scsclient.lib

class RScsClientBase : public RSessionBase

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 &)
Inherited Attributes
RHandleBase::iHandle
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
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()

Detailed Description

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.

Constructor & Destructor Documentation

RScsClientBase ( )

IMPORT_CRScsClientBase()[protected]

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

Member Function 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
aFunctionFunction identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.
Return Value
Error code with which the server completed the request.

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
aFunctionSession function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.
aArgsStandard IPC arguments.
Return Value
Error code with which the server completed the request.

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
aFunctionSession function identifier. Bits 31:24 must be zero, because they are reserved for SCS commands.
aArgsStandard IPC arguments.
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
aFunctionImplementation function. This must be the same value that was supplied to CallSessionFunction.

Close ( )

IMPORT_C voidClose()

Reimplemented from RHandleBase::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 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
aSvrNameName of server to connect to.
aReqVerRequired server version.
aExeNameExecutable which hosts the server. This function will launch this executable if the server is not running.
aFullExeUidThe server executable's full UID. This ensures the intended executable is started, and not another executable with the same name.
Return Value
Symbian OS error code. KErrNone indicates success, and any other value indicates failure.

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.

See also: 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.

See also: EndServerHeapFail __UHEAP_MARK __UHEAP_SETFAIL

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

Return Value
Symbian OS error code where KErrNone indicates success and any other value indicates failure.