CScsSession Class Reference

class CScsSession : public CSession2

When this session object is destroyed (because the client-server session has closed,) this notifies the server object which decrements the session count. Therefore, the server can be shut down after an inactivity period during which there are no open sessions.

This object also frees any remaining subsession objects when it is closed.

Inherits from

Constructor & Destructor Documentation

CScsSession(CScsServer &)

IMPORT_CCScsSession(CScsServer &aServer)

Setup the iServer member variable so it can be used during construction

Parameters

CScsServer & aServer

~CScsSession()

IMPORT_C~CScsSession()[protected, virtual]

Deletes any subsessions.

Deletes any outstanding requests.

Decrements the server's session count so the server can be shut down if there are no open sessions.

Member Functions Documentation

CallSubsessionFunctionL(TInt, const RMessage2 &)

TBool CallSubsessionFunctionL(TIntaFunction,
const RMessage2 &aMessage
)[private]

Pass the supplied function identifier and message to the subsession which is identified in the message.

If the subsession cannot be found this function leaves with KErrBadHandle, and the client is panicked in ServiceError.

Parameters

TInt aFunctionFunction identifier without SCS code.
const RMessage2 & aMessageClient message.

CancelAsyncSessionRequestL(TInt)

voidCancelAsyncSessionRequestL(TIntaFunction)[private]

This function is called when handling an ECancelSessionFunction message. If the outstanding function cannot be found, this function does nothing.

Parameters

TInt aFunctionImplementation function without SCS code.

CancelAsyncSubsessionRequestL(TInt, const RMessage2 &)

voidCancelAsyncSubsessionRequestL(TIntaFunction,
const RMessage2 &aMessage
)[private]

Cancel an outstanding asynchronous request for the subsession identified in the supplied message.

Parameters

TInt aFunctionFunction identifier without SCS code.
const RMessage2 & aMessageStandard server-side message handle. The fourth integer contains the subsession handle.

CloseAllSubsessionsL()

IMPORT_C voidCloseAllSubsessionsL()[protected]

CloseSubsessionL(const RMessage2 &)

voidCloseSubsessionL(const RMessage2 &aMessage)[private]

Delete the subsession identified in the supplied message.

If the subsession cannot be found this function leaves with KErrBadHandle, and the client is panicked in ServiceError.

Parameters

const RMessage2 & aMessageStandard server-side message handle. The fourth integer contains the subsession handle.

ConstructL()

IMPORT_C voidConstructL()[protected]

The subsession [handle] container could be constructed here, but that is deferred until the subsession is allocated to avoid the memory overhead for sessions which may not require subsessions.

CreateSubsessionL(TInt, const RMessage2 &)

voidCreateSubsessionL(TIntaFunction,
const RMessage2 &aMessage
)[private]

Attempt to allocate a subsession object for this session. The actual subsession allocation is delegated to the subclass's implementation of DoCreateSubsessionL. If the subclass has not reimplemented this function, then default implementation leaves with KErrNotSupported.

Parameters

TInt aFunctionFunction identifier without SCS code.
const RMessage2 & aMessageStandard server-side message object.

DeleteSubsessionContainers()

voidDeleteSubsessionContainers()[private]

Free the handle and object containers which this session uses to manage subsessions. It is safe to call this function if the containers were not set up successfully.

DoCreateSubsessionL(TInt, const RMessage2 &)

IMPORT_C CScsSubsession *DoCreateSubsessionL(TIntaFunction,
const RMessage2 &aMessage
)[private, virtual]

This default implementation leaves with KErrNotSupported. The subclass does not have to supply its own implementation unless it actually wants to support subsessions.

leave
KErrNotSupported.

Parameters

TInt aFunctionFunction identifier without SCS code. The subclass implementation of this function would use this to decide what kind of subsession object to create.
const RMessage2 & aMessageClient message. Not used.

DoServiceL(TInt, const RMessage2 &)

TBool DoServiceL(TIntaFunction,
const RMessage2 &aMessage
)[private, pure virtual]

This function is called from ServiceL after it has removed the SCS-specific field and handled any other messages. I.e., it is called for functions which really require the session as opposed to subsession commands or debugging commands such as heap failure.

Parameters

TInt aFunctionImplementation function, i.e. the function identifier with the SCS field removed.
const RMessage2 & aMessageStandard server message object.

FindSessionAsyncRequest(TInt)

CAsyncRequest *FindSessionAsyncRequest(TIntaFunction)[private]

Parameters

TInt aFunction

GetSubsessionL(const RMessage2 &)

CScsSubsession *GetSubsessionL(const RMessage2 &aMessage)[private]

Extract subsession handle from the supplied message and return a pointer to the corresponding subsession object.

leave
KErrBadHandle if the handle does not identify a current subsession.

Parameters

const RMessage2 & aMessageStandard server-side message object. The fourth argument is the subsession handle.

PreCloseSession()

voidPreCloseSession()[private]

This function is invoked from RScsClientBase::Close just before the session is closed, to cancel any outstanding requests.

ServiceError(const RMessage2 &, TInt)

IMPORT_C voidServiceError(const RMessage2 &aMessage,
TIntaError
)[protected, virtual]

Override CSession2 by handling any leave which occurred during the ServiceL.

Panick the client if the leave is because of a bad descriptor or subsession handle. Otherwise, complete the request with the error code.

CSession2::ServiceError

Parameters

const RMessage2 & aMessageMessage which caused leave to occur.
TInt aErrorLeave code. This is a Symbian OS error code.

ServiceL(const RMessage2 &)

IMPORT_C voidServiceL(const RMessage2 &aMessage)[protected, virtual]

Implement CSession2 by handling any SCS-specific messages, and otherwise delegating to the subclass' implementation.

Parameters

const RMessage2 & aMessageStandard server-side message object.

Member Data Documentation

TInt iPreCreateSubsessionCount

TInt iPreCreateSubsessionCount[private]

Number of open subsessions before a new one is created. This is used to manage cleanup if the subsession cannot be created.

CScsServer & iServer

CScsServer &iServer

CObjectIx * iSsHandles

CObjectIx *iSsHandles[private]

CObjectCon * iSsObjects

CObjectCon *iSsObjects[private]