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.
Constructor & Destructor Documentation
CScsSession(CScsServer &)
Setup the iServer member variable so it can be used during construction
~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 &)
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 aFunction | Function identifier without SCS code. |
const RMessage2 & aMessage | Client message. |
CancelAsyncSessionRequestL(TInt)
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.
Parameters
TInt aFunction | Implementation function without SCS code. |
CancelAsyncSubsessionRequestL(TInt, const RMessage2 &)
void | CancelAsyncSubsessionRequestL | ( | TInt | aFunction, |
| const RMessage2 & | aMessage |
| ) | [private] |
Cancel an outstanding asynchronous request for the subsession identified in the supplied message.
Parameters
TInt aFunction | Function identifier without SCS code. |
const RMessage2 & aMessage | Standard server-side message handle. The fourth integer contains the subsession handle. |
CloseAllSubsessionsL()
IMPORT_C void | CloseAllSubsessionsL | ( | ) | [protected] |
CloseSubsessionL(const RMessage2 &)
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.
Parameters
const RMessage2 & aMessage | Standard server-side message handle. The fourth integer contains the subsession handle. |
ConstructL()
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.
CreateSubsessionL(TInt, const RMessage2 &)
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.
Parameters
TInt aFunction | Function identifier without SCS code. |
const RMessage2 & aMessage | Standard server-side message object. |
DeleteSubsessionContainers()
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.
DoCreateSubsessionL(TInt, const RMessage2 &)
This default implementation leaves with KErrNotSupported. The subclass does not have to supply its own implementation unless it actually wants to support subsessions.
Parameters
TInt aFunction | Function identifier without SCS code. The subclass implementation of this function would use this to decide what kind of subsession object to create. |
const RMessage2 & aMessage | Client message. Not used. |
DoServiceL(TInt, const RMessage2 &)
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 aFunction | Implementation function, i.e. the function identifier with the SCS field removed. |
const RMessage2 & aMessage | Standard server message object. |
FindSessionAsyncRequest(TInt)
GetSubsessionL(const RMessage2 &)
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 & aMessage | Standard server-side message object. The fourth argument is the subsession handle. |
PreCloseSession()
void | PreCloseSession | ( | ) | [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 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.
CSession2::ServiceError
Parameters
const RMessage2 & aMessage | Message which caused leave to occur. |
TInt aError | Leave code. This is a Symbian OS error code. |
ServiceL(const RMessage2 &)
IMPORT_C void | ServiceL | ( | const RMessage2 & | aMessage | ) | [protected, virtual] |
Implement CSession2 by handling any SCS-specific messages, and otherwise delegating to the subclass' implementation.
Parameters
const RMessage2 & aMessage | Standard 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.
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.