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.
Public Member Functions | |
---|---|
CScsSession ( CScsServer &) |
Protected Member Functions | |
---|---|
~CScsSession () | |
IMPORT_C void | CloseAllSubsessionsL () |
IMPORT_C void | ConstructL () |
IMPORT_C void | ServiceError (const RMessage2 &, TInt ) |
IMPORT_C void | ServiceL (const RMessage2 &) |
Private Member Functions | |
---|---|
TBool | CallSubsessionFunctionL ( TInt , const RMessage2 &) |
void | CancelAsyncSessionRequestL ( TInt ) |
void | CancelAsyncSubsessionRequestL ( TInt , const RMessage2 &) |
void | CloseSubsessionL (const RMessage2 &) |
void | CreateSubsessionL ( TInt , const RMessage2 &) |
void | DeleteSubsessionContainers () |
IMPORT_C CScsSubsession * | DoCreateSubsessionL ( TInt , const RMessage2 &) |
TBool | DoServiceL ( TInt , const RMessage2 &) |
CAsyncRequest * | FindSessionAsyncRequest ( TInt ) |
CScsSubsession * | GetSubsessionL (const RMessage2 &) |
void | PreCloseSession () |
Inherited Enumerations | |
---|---|
CSession2:TPanicNo |
Public Attributes | |
---|---|
CScsServer & | iServer |
Private Attributes | |
---|---|
TInt | iPreCreateSubsessionCount |
CObjectIx * | iSsHandles |
CObjectCon * | iSsObjects |
IMPORT_C | CScsSession | ( | CScsServer & | aServer | ) |
Setup the iServer member variable so it can be used during construction
CScsServer & aServer |
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.
TBool | CallSubsessionFunctionL | ( | TInt | aFunction, |
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.
void | CancelAsyncSessionRequestL | ( | TInt | aFunction | ) | [private] |
This function is called when handling an ECancelSessionFunction message. If the outstanding function cannot be found, this function does nothing.
TInt aFunction | Implementation function without SCS code. |
void | CancelAsyncSubsessionRequestL | ( | TInt | aFunction, |
const RMessage2 & | aMessage | |||
) | [private] |
Cancel an outstanding asynchronous request for the subsession identified in the supplied message.
void | CloseSubsessionL | ( | 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.
const RMessage2 & aMessage | Standard server-side message handle. The fourth integer contains the subsession handle. |
IMPORT_C void | ConstructL | ( | ) | [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.
void | CreateSubsessionL | ( | TInt | aFunction, |
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.
void | DeleteSubsessionContainers | ( | ) | [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.
IMPORT_C CScsSubsession * | DoCreateSubsessionL | ( | TInt | aFunction, |
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.
TBool | DoServiceL | ( | TInt | aFunction, |
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.
CAsyncRequest * | FindSessionAsyncRequest | ( | TInt | aFunction | ) | [private] |
TInt aFunction |
CScsSubsession * | GetSubsessionL | ( | const RMessage2 & | aMessage | ) | [private] |
Extract subsession handle from the supplied message and return a pointer to the corresponding subsession object.
const RMessage2 & aMessage | Standard server-side message object. The fourth argument is the subsession handle. |
void | PreCloseSession | ( | ) | [private] |
This function is invoked from RScsClientBase::Close just before the session is closed, to cancel any outstanding requests.
IMPORT_C void | ServiceError | ( | const RMessage2 & | aMessage, |
TInt | aError | |||
) | [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.
IMPORT_C void | ServiceL | ( | const RMessage2 & | aMessage | ) | [protected, virtual] |
Implement CSession2 by handling any SCS-specific messages, and otherwise delegating to the subclass' implementation.
const RMessage2 & aMessage | Standard server-side message object. |
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.
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.