class CServer2 : public CActive |
Abstract base class for servers (version 2).
This is an active object. It accepts requests from client threads and forwards them to the relevant server-side client session. It also handles the creation of server-side client sessions as a result of requests from client threads.
A server must define and implement a derived class.
(Note that this class should be used instead of CServer)
Public Member Functions | |
---|---|
~CServer2() | |
IMPORT_C void | ReStart() |
RServer2 | Server() |
IMPORT_C void | SetMaster(const CServer2 *) |
IMPORT_C void | SetPinClientDescriptors(TBool) |
IMPORT_C TInt | Start(const TDesC &) |
IMPORT_C void | StartL(const TDesC &) |
Protected Member Functions | |
---|---|
CServer2(TInt, TServerType) | |
IMPORT_C void | DoCancel() |
IMPORT_C void | DoConnect(const RMessage2 &) |
IMPORT_C TInt | Extension_(TUint, TAny *&, TAny *) |
const RMessage2 & | Message() |
IMPORT_C TInt | RunError(TInt) |
IMPORT_C void | RunL() |
Private Member Functions | |
---|---|
void | BadMessage(const RMessage2 &) |
void | Connect(const RMessage2 &) |
void | Disconnect(const RMessage2 &) |
void | DoConnectL(const RMessage2 &, CSession2 *volatile &) |
IMPORT_C CSession2 * | NewSessionL(const TVersion &, const RMessage2 &) |
void | NotConnected(const RMessage2 &) |
Public Member Enumerations | |
---|---|
enum | TPanic { EBadMessageNumber, ESessionNotConnected, ESessionAlreadyConnected, EClientDoesntHaveRequiredCaps } |
enum | TServerType { EUnsharableSessions = EIpcSession_Unsharable, ESharableSessions = EIpcSession_Sharable, EGlobalSharableSessions = EIpcSession_GlobalSharable } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Protected Attributes | |
---|---|
TDblQueIter< CSession2 > | iSessionIter |
Private Attributes | |
---|---|
RMessage2 | iMessage |
RServer2 | iServer |
TUint16 | iServerOpts |
TUint8 | iServerRole |
TDblQue< CSession2 > | iSessionQ |
TUint8 | iSessionType |
TAny * | iSpare |
Inherited Attributes | |
---|---|
CActive::iStatus |
IMPORT_C | CServer2 | ( | TInt | aPriority, |
TServerType | aType = EUnsharableSessions | |||
) | [protected] |
TInt aPriority | |
TServerType aType = EUnsharableSessions |
void | BadMessage | ( | const RMessage2 & | aMessage | ) | [private, static] |
const RMessage2 & aMessage |
void | Connect | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
void | Disconnect | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
IMPORT_C void | DoCancel | ( | ) | [protected, virtual] |
Implements cancellation of an outstanding request.
This function is called as part of the active object's Cancel().
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel() must not wait for event completion; this is handled by Cancel().
IMPORT_C void | DoConnect | ( | const RMessage2 & | aMessage | ) | [protected, virtual] |
const RMessage2 & aMessage |
void | DoConnectL | ( | const RMessage2 & | aMessage, |
CSession2 *volatile & | aSession | |||
) | [private] |
IMPORT_C TInt | Extension_ | ( | TUint | aExtensionId, |
TAny *& | a0, | |||
TAny * | a1 | |||
) | [protected, virtual] |
const RMessage2 & | Message | ( | ) | const [protected, inline] |
Gets a reference to the server's current message.
The current message that contains the client request details.
IMPORT_C CSession2 * | NewSessionL | ( | const TVersion & | aVersion, |
const RMessage2 & | aMessage | |||
) | const [private, pure virtual] |
Creates a server-side session object.
The session represents a communication link between a client and a server, and its creation is initiated by the client through a call to one of the RSessionBase::CreateSession() variants.
A server must provide an implementation, which as a minimum should:
check that the version of the server is compatible with the client by comparing the client supplied version number against the server's version number; it should leave if there is incompatibility.
construct and return the server side client session object.
A pointer to the newly created server-side session object.
void | NotConnected | ( | const RMessage2 & | aMessage | ) | [private, static] |
const RMessage2 & aMessage |
IMPORT_C void | RunL | ( | ) | [protected, virtual] |
Handles an active object's request completion event.
A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.
The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.
Before calling this active object's RunL() function, the active scheduler has:
1. decided that this is the highest priority active object with a completed request
2. marked this active object's request as complete (i.e. the request is no longer outstanding)
RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.
Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.
CActiveScheduler::WaitForAnyRequest
TRAPD
RServer2 | Server | ( | ) | const [inline] |
Gets a handle to the server.
Note that the RServer2 object is classified as Symbian internal, and its member functions cannot be acessed. However, the handle can be passed to the RSessionBase::CreateSession() variants that take a server handle.
The handle to the server.
IMPORT_C void | SetMaster | ( | const CServer2 * | aServer | ) |
const CServer2 * aServer |
EBadMessageNumber | |
ESessionNotConnected | |
ESessionAlreadyConnected | |
EClientDoesntHaveRequiredCaps |
This enumeration defines the maximum sharability of sessions opened with this server; for backwards compatibilty, these should be have the same values as the corresponding EIpcSessionType enumeration
EUnsharableSessions = EIpcSession_Unsharable | |
ESharableSessions = EIpcSession_Sharable | |
EGlobalSharableSessions = EIpcSession_GlobalSharable |