Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CSession2 Class Referenceabstract

Represents a session (version 2) for a client thread on the server-side. More...

#include <e32base.h>

Inheritance diagram for CSession2:
CBase

Public Types

enum  TPanicNo { ESesCountResourcesNotImplemented =1 , ESesFoundResCountHeaven }
 

Public Member Functions

virtual IMPORT_C ~CSession2 ()=0
 Destructor.
 
const CServer2 * Server () const
 Gets the server active object that handles messages for this session.
 
IMPORT_C void ResourceCountMarkStart ()
 Marks the start of resource count checking.
 
IMPORT_C void ResourceCountMarkEnd (const RMessage2 &aMessage)
 Marks the end of resource count checking.
 
virtual IMPORT_C TInt CountResources ()
 Gets the number of resources currently in use.
 
virtual void ServiceL (const RMessage2 &aMessage)=0
 Handles the servicing of a client request that has been passed to the server.
 
virtual IMPORT_C void ServiceError (const RMessage2 &aMessage, TInt aError)
 Handles the situation when a call to CSession2::ServiceL(), which services a client request, leaves.
 
IMPORT_C void SetServer (const CServer2 *aServer)
 Designates the (master or slave) server that is to service this session.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Protected Member Functions

IMPORT_C CSession2 ()
 Default constructor.
 
virtual IMPORT_C void Disconnect (const RMessage2 &aMessage)
 Called by a server when it receives a disconnect message for the session.
 
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Friends

class CServer2
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Detailed Description

Represents a session (version 2) for a client thread on the server-side.

A session acts as a channel of communication between the client and the server. A client thread can have multiple concurrent sessions with a server.

A session can be:

  • restricted to the creating thread
  • can be shared with other threads in the same process
  • can be shared by all threads in the system.

A server must define and implement a derived class. In particular, it must provide an implementation for the ServiceL() virtual function.

(Note that this class should be used instead of CSession)

API status
Published to all clients. Released API.

Definition at line 2240 of file e32base.h.

Member Enumeration Documentation

◆ TPanicNo

API status
Internal component API.
Enumerator
ESesCountResourcesNotImplemented 
ESesFoundResCountHeaven 

Definition at line 2275 of file e32base.h.

Constructor & Destructor Documentation

◆ ~CSession2()

IMPORT_C CSession2::~CSession2 ( )
pure virtual

Destructor.

It frees resources prior to destruction of the object. Specifically, it removes this session object from the server active object s list of sessions.

(generated from Symbian Developer Library)

◆ CSession2()

IMPORT_C CSession2::CSession2 ( )
protected

Default constructor.

This constructor is empty.

(generated from Symbian Developer Library)

Member Function Documentation

◆ CountResources()

IMPORT_C TInt CSession2::CountResources ( )
virtual

Gets the number of resources currently in use.

Derived classes must provide a suitable implementation. The meaning of a resource depends on the design intent of the server.

The default implementation panics the calling thread (CSession 1) before returning KErrGeneral.

CSession2::ResourceCountmarkStart() CSession2::ResourceCountmarkEnd()

(generated from Symbian Developer Library)

◆ Disconnect()

IMPORT_C void CSession2::Disconnect ( const RMessage2 &  aMessage)
protectedvirtual

Called by a server when it receives a disconnect message for the session.

This message is sent by the kernel when all client handles to the session have been closed. This method deletes the session object and completes the disconnect message.

A derived session implementation may overide this virtual method if it needs to perform any asynchronous cleanup actions, these actions must end with a call to the base class implementation of this method, which will delete the session object and complete the disconnect message

Parameters
aMessageThe disconnect message.
Post-condition
'this' session object has been deleted.

(generated from Symbian Developer Library)

◆ Extension_()

IMPORT_C TInt CSession2::Extension_ ( TUint  aExtensionId,
TAny *&  a0,
TAny *  a1 
)
protectedvirtual

Extension function.

(generated from Symbian Developer Library)

Reimplemented from CBase.

◆ ResourceCountMarkEnd()

IMPORT_C void CSession2::ResourceCountMarkEnd ( const RMessage2 &  aMessage)

Marks the end of resource count checking.

The function takes the current resource count by calling CSession2::CountResources(), and compares it with the resource count value saved when CSession2::ResourceCountMarkStart() was called. If the resource counts differ, then the client thread is panicked (CSession 2)".

The client/server framework does not call this function (nor does it call CSession2::ResourceCountMarkStart()), but the function is available for servers to use, if appropriate.

CSession2::CountResources() CSession2::ResourceCountMarkStart()

Parameters
aMessageRepresents the details of the client request that is requesting this resource check.

(generated from Symbian Developer Library)

◆ ResourceCountMarkStart()

IMPORT_C void CSession2::ResourceCountMarkStart ( )

Marks the start of resource count checking.

It sets up a starting value for resource count checking.

The function sets up a starting value for resource count checking by using the value returned by a call to CSession2::CountResources(), and is the value that will be used for comparison if CSession2::ResourceCountMarkEnd() is called at some later time.

The client/server framework does not call this function (nor does it call CSession2::ResourceCountMarkEnd()), but is available for servers to use, if appropriate.

CSession2::CountResources() CSession2::ResourceCountMarkEnd()

(generated from Symbian Developer Library)

◆ Server()

const CServer2 * CSession2::Server ( ) const
inline

Gets the server active object that handles messages for this session.

This is the instance of the CServer2 derived class that created this session object.

(generated from Symbian Developer Library)

◆ ServiceError()

IMPORT_C void CSession2::ServiceError ( const RMessage2 &  aMessage,
TInt  aError 
)
virtual

Handles the situation when a call to CSession2::ServiceL(), which services a client request, leaves.

Servers are active objects, and the call to CSession2::ServiceL() to handle a client request is executed as part of the server's active object RunL() function. If the RunL() leaves, the active object framework calls the active object's RunError() function. The server framework implements this as a call to ServiceError()

The default behaviour of this function is to complete the message, using the leave value, if it has not already been completed.

Servers can re-implement this as appropriate.

CActive::RunL() CActive::RunError()

Parameters
aMessageThe message containing the details of the client request that caused the leave.
aErrorThe leave code.

(generated from Symbian Developer Library)

◆ ServiceL()

virtual void CSession2::ServiceL ( const RMessage2 &  aMessage)
pure virtual

Handles the servicing of a client request that has been passed to the server.

This function must be implemented in a derived class. The details of the request are contained within the message.

Parameters
aMessageThe message containing the details of the client request.

◆ SetServer()

IMPORT_C void CSession2::SetServer ( const CServer2 *  aServer)

Designates the (master or slave) server that is to service this session.

This may be called from the NewSessionL() method of the CServer2-derived class or from the CreateL() method of the CSession2-derived class.

It must not be called after CreateL() has finished, as this is the point at which the session binding become irrevocable.

CServer::DoConnect()

(generated from Symbian Developer Library)

Friends And Related Symbol Documentation

◆ CServer2

friend class CServer2
friend

Definition at line 2242 of file e32base.h.


The documentation for this class was generated from the following files: