Location:
e32base.h
Link against: euser.lib
CServer
Supported from 5.0
Abstract base class for servers.
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 for connection from client threads.
A server must define and implement a derived class.
|
Defined in CServer
:
CServer()
, EMultipleSessions
, ESharableSessions
, ESingleSession
, EUnsharableSessions
, Message()
, NewSessionL()
, ReStart()
, Start()
, StartL()
, TServerType
, TSessionControl
, iControl
, iName
, iSessionIter
, ~CServer()
Inherited from CActive
:
Cancel()
,
Deque()
,
DoCancel()
,
EPriorityHigh
,
EPriorityIdle
,
EPriorityLow
,
EPriorityStandard
,
EPriorityUserInput
,
IsActive()
,
IsAdded()
,
Priority()
,
RunError()
,
RunL()
,
SetActive()
,
SetPriority()
,
TPriority
,
iStatus
Inherited from CBase
:
operator new()
protected: CServer(TInt aPriority,TServerType aType=EUnsharableSessions);
Supported from 6.0
Constructs the server object with the specified active object priority.
Derived classes must define and implement a constructor through which the priority can be specified. A typical implementation calls this server base class constructor through a constructor initialization list.
|
protected: CServer(TInt aPriority);
Withdrawn in 6.0
Constructs the server object with the specified active object priority.
Derived classes must define and implement a constructor through which the priority can be specified. A typical implementation calls this server base class constructor through a constructor initialization list.
|
~CServer();
Supported from 6.0
Frees resources prior to destruction. Specifically, it:
cancels any outstanding request for messages
deletes all server-side client session objects
~CServer();
Withdrawn in 6.0
Destructor. This frees resources prior to destruction. Specifically, it:
cancels any outstanding request for messages
deletes all server-side client session objects
deletes the heap descriptor contining the server's name.
TInt Start(const TDesC& aName);
Supported from 6.0
Adds the server with the specified name to the active scheduler and issues the first request for messages.
|
|
void StartL(const TDesC& aName);
Supported from 6.0
Adds the server with the specified name to the active scheduler and issues the first request for messages and leaves if the operation fails
If the operation fails, the function leaves with one of the system-wide error codes.
|
TInt Start();
Withdrawn in 6.0
Adds the server to the active scheduler and issues the first request for messages.
The function raises an E32USER-CBase 55 panic, if the server has not been given a name.
|
void StartL();
Withdrawn in 6.0
Adds the server to the active scheduler and issues the first request for messages. If the operation fails, the function leaves with one of the system wide error codes.
The function raises an E32USER-CBase 55 panic, if the server has not been given a name.
void ReStart();
Re-starts the issuing of requests for messages.
It is necessary to call this, as part of the error recovery procedure, if a server-side client session's service handler leaves. The call is normally made in the server's implementation of the active scheduler error handler.
const RMessage& Message() const;
Returns a reference to the server's current message.
|
private: virtual CSharableSession* NewSessionL(const TVersion& aVersion) const = 0;
Supported from 6.0
Creates a server-side client session object.
An implementation of this function 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 incompatibilty.
construct the server side client session object.
This function is called when a client makes a request to connect to the server.
|
|
protected: virtual CSession* NewSessionL(RThread aClient,const TVersion& aVersion) const = 0;
Withdrawn in 6.0
Creates a server-side client session object for a client thread.
An implementation of this function 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 incompatibilty.
construct the server side client session object.
This function is called when a client makes a request to connect to the server.
|
|
protected: TDblQueIter<CSession> iSessionIter
An iterator for the list of sessions connected to the server.
TSessionControl iControl
Withdrawn in 6.0
Determines whether a client thread can connect once or more than once to the server.
By default, a client thread can connect to the server more than once.
HBufC* iName
Withdrawn in 6.0
A pointer to a heap descriptor containing the name of the server.
The server cannot be started until the derived class has created a heap descriptor containing the server name. The heap descriptor is deleted by the constructor.
protected: TServerType
Supported from 6.0
Indicates whether the server creates sharable sessions.
|
TSessionControl
Withdrawn in 6.0
Session type.
|