CCommSession Class Reference

class CCommSession : public CSession2

A client session. Corresponds to an RCommSession object in the client.

Inherits from

Nested Classes and Structures

Public Member Functions
CCommSession (CC32ThreadManager *)
~CCommSession ()
TInt AddCSYToSessionL (const TDesC &, TBool &)
CC32WorkerThread & C32WorkerThread ()
void CloseCommModuleL (const RMessage2 &)
void CompleteDisconnect ()
void ConstructL ()
void CountSubSessions ( CCommSession *, CCommSubSession *, TInt , TAny *)
const CC32Dealer & Dealer ()
TInt DisconnectPlayers ()
TInt ExtractPortNameAndNumber (const RMessagePtr2 &, TDes &, TUint &, TInt &)
void ForgetSubSession ( CCommSession *, CCommSubSession *, TInt , TAny *)
TBool IsDisconnectListEmpty ()
TBool IsPlayerInDisconnectList ( CommsFW::TWorkerId )
void LoadCommModuleL (const RMessage2 &, CommsFW::TWorkerId , TBool , const TDesC &)
CCommSession * NewL (CC32ThreadManager *)
void NewPortL (const RMessage2 &)
void NumPorts (const RMessage2 &)
void PortInfo (const RMessage2 &, TInt )
void PortInfoL (const RMessage2 &, const TPortName &)
void ProcessSubSessions ( CommsFW::TWorkerId , TSubSessionProcessor , TAny *)
TInt Read ( TInt , const RMessagePtr2 &, TDes8 &, TInt )
TInt Read ( TInt , const RMessagePtr2 &, TDes16 &, TInt )
TInt RemoveCSYFromSession (const TDesC &, TBool &)
void ServiceError (const RMessage2 &, TInt )
void ServiceL (const RMessage2 &)
void SessionCloseResp ( CommsFW::TWorkerId )
CC32SubSessionIx & SubSessions ()
CommsFW::TWorkerId WorkerId ()
TInt Write ( TInt , const RMessagePtr2 &, const TDesC8 &, TInt )
TInt Write ( TInt , const RMessagePtr2 &, const TDesC16 &, TInt )
Protected Member Functions
void Disconnect ()
void Disconnect (const RMessage2 &)
void DontCompleteCurrentRequest ()
void ForwardMessageL (const RMessage2 &, CCommSubSession *, CommsFW::TWorkerId )
void ForwardMessageL (const RMessage2 &, CCommSubSession &)
void SafeComplete (const RMessagePtr2 &, TInt )
Private Member Functions
void AddPlayerToDisconnectList ( CommsFW::TWorkerId )
void CloseSubSessionL (const RMessage2 &, CCommSubSession::TSubSessionType )
void RemovePlayerFromDisconnectList ( CommsFW::TWorkerId )
CCommSubSession * SubSessionFromHandle ( TUint , CCommSubSession::TSubSessionType )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CSession2::CSession2()
CSession2::CountResources()
CSession2::Extension_(TUint,TAny *&,TAny *)
CSession2::ResourceCountMarkEnd(const RMessage2 &)
CSession2::ResourceCountMarkStart()
CSession2::Server()const
CSession2::SetServer(const CServer2 *)
CSession2::~CSession2()
Inherited Enumerations
CSession2:TPanicNo
Public Member Type Definitions
typedef RPointerArray < HBufC > RCSYFileNameContainer
typedef void(* TSubSessionProcessor
Private Member Type Definitions
typedef CSession2 inherited
Private Attributes
TBool iComplete
RCSYFileNameContainer iCsyCon
RMessage2 iDisconnectMessage
TUint32 iDisconnectPlayers
CC32SessionCloseTimer * iSessionCloseTimer
CC32SubSessionIx iSubSessions
CC32ThreadManager * iThreadManager

Constructor & Destructor Documentation

CCommSession(CC32ThreadManager *)

CCommSession ( CC32ThreadManager * aThreadManager )

C'Tor - must pass client to CSession

Parameters

CC32ThreadManager * aThreadManager

~CCommSession()

~CCommSession ( ) [virtual]

D'tor - clean up and go home.

Member Functions Documentation

AddCSYToSessionL(const TDesC &, TBool &)

TInt AddCSYToSessionL ( const TDesC & aCSYFileName,
TBool & aIsDuplicate
)

Parameters

const TDesC & aCSYFileName
TBool & aIsDuplicate

AddPlayerToDisconnectList(CommsFW::TWorkerId)

void AddPlayerToDisconnectList ( CommsFW::TWorkerId aPlayerId ) [private]

Parameters

CommsFW::TWorkerId aPlayerId

C32WorkerThread()

CC32WorkerThread & C32WorkerThread ( ) const

CloseCommModuleL(const RMessage2 &)

void CloseCommModuleL ( const RMessage2 & aMessage )

Close a comm module

Parameters

const RMessage2 & aMessage

CloseSubSessionL(const RMessage2 &, CCommSubSession::TSubSessionType)

void CloseSubSessionL ( const RMessage2 & aMessage,
CCommSubSession::TSubSessionType aType
) [private]

Parameters

const RMessage2 & aMessage
CCommSubSession::TSubSessionType aType

CompleteDisconnect()

void CompleteDisconnect ( ) [inline]

ConstructL()

void ConstructL ( )

CountSubSessions(CCommSession *, CCommSubSession *, TInt, TAny *)

void CountSubSessions ( CCommSession * aSession,
CCommSubSession * aSubSession,
TInt aSubSessionHandle,
TAny * aArg
) [static]

Parameters

CCommSession * aSession
CCommSubSession * aSubSession
TInt aSubSessionHandle
TAny * aArg

Dealer()

const CC32Dealer & Dealer ( ) const [inline]

Disconnect()

void Disconnect ( ) [protected]

Sends SessionClosed to all no-resident players. Add self to Dealers list of disconnecting sessions.

Disconnect(const RMessage2 &)

void Disconnect ( const RMessage2 & aMessage ) [protected, virtual]

Parameters

const RMessage2 & aMessage

DisconnectPlayers()

TInt DisconnectPlayers ( )

DontCompleteCurrentRequest()

void DontCompleteCurrentRequest ( ) [protected]

ExtractPortNameAndNumber(const RMessagePtr2 &, TDes &, TUint &, TInt &)

TInt ExtractPortNameAndNumber ( const RMessagePtr2 & aMessage,
TDes & aPortName,
TUint & aPortNumber,
TInt & aLength
)

Extract the port name and number from RMessage aPortName on return is full name including double-colon and number. The length is not policed for compliance with TPortName type since this would break a backwards compatibility behaviour. aLength is length of the actual name part without the double-colon and port number.

Parameters

const RMessagePtr2 & aMessage
TDes & aPortName
TUint & aPortNumber
TInt & aLength

ForgetSubSession(CCommSession *, CCommSubSession *, TInt, TAny *)

void ForgetSubSession ( CCommSession * aSession,
CCommSubSession * aSubSession,
TInt aSubSessionHandle,
TAny * aArg
) [static]

Parameters

CCommSession * aSession
CCommSubSession * aSubSession
TInt aSubSessionHandle
TAny * aArg

ForwardMessageL(const RMessage2 &, CCommSubSession *, CommsFW::TWorkerId)

void ForwardMessageL ( const RMessage2 & aMessage,
CCommSubSession * aSS,
CommsFW::TWorkerId aWorker
) [protected]

Parameters

const RMessage2 & aMessage
CCommSubSession * aSS
CommsFW::TWorkerId aWorker

ForwardMessageL(const RMessage2 &, CCommSubSession &)

void ForwardMessageL ( const RMessage2 & aMessage,
CCommSubSession & aSubSess
) [protected]

Parameters

const RMessage2 & aMessage IPC message received from client.
CCommSubSession & aSubSess Subsession that needs to deal with this message.

IsDisconnectListEmpty()

TBool IsDisconnectListEmpty ( ) const

IsPlayerInDisconnectList(CommsFW::TWorkerId)

TBool IsPlayerInDisconnectList ( CommsFW::TWorkerId aPlayerId ) const

Parameters

CommsFW::TWorkerId aPlayerId

LoadCommModuleL(const RMessage2 &, CommsFW::TWorkerId, TBool, const TDesC &)

void LoadCommModuleL ( const RMessage2 & aMessage,
CommsFW::TWorkerId aWorker,
TBool defaulted,
const TDesC & aFilename
)

Load a comm module We assume that the worker we need is loaded if we've come this far. aFilename - full filename of CSY aDefaulted - True if the supplied filename is for a CSY that is not known via CSYList values in CMI file. In this case aWorker will be the default thread

Parameters

const RMessage2 & aMessage
CommsFW::TWorkerId aWorker
TBool defaulted
const TDesC & aFilename

NewL(CC32ThreadManager *)

CCommSession * NewL ( CC32ThreadManager * aThreadManager ) [static]

Parameters

CC32ThreadManager * aThreadManager

NewPortL(const RMessage2 &)

void NewPortL ( const RMessage2 & aMessage )

Ask the port manager to open a port in the CSY which is then added to this session's port list. If another session has already opened the same port, the port manager will still give us a reference if the port is not being used exclusively.

Parameters

const RMessage2 & aMessage handle to the IPC message from the client

NumPorts(const RMessage2 &)

void NumPorts ( const RMessage2 & aMessage )

Write back the number of CSYs loaded to the client

Parameters

const RMessage2 & aMessage

PortInfo(const RMessage2 &, TInt)

void PortInfo ( const RMessage2 & aMessage,
TInt aPortNum
)

Write back the port info to the client for a specified port aNumber is the client supplied index of the CSY

Parameters

const RMessage2 & aMessage
TInt aPortNum number of the port to get information about

PortInfoL(const RMessage2 &, const TPortName &)

void PortInfoL ( const RMessage2 & aMessage,
const TPortName & aPortName
)

Write back the port info to the client for a specified port

Parameters

const RMessage2 & aMessage
const TPortName & aPortName name of the port/filename to get information about

ProcessSubSessions(CommsFW::TWorkerId, TSubSessionProcessor, TAny *)

void ProcessSubSessions ( CommsFW::TWorkerId aPeerId,
TSubSessionProcessor aSubSessionProcessor,
TAny * aPtr
)

Parameters

CommsFW::TWorkerId aPeerId
TSubSessionProcessor aSubSessionProcessor
TAny * aPtr

Read(TInt, const RMessagePtr2 &, TDes8 &, TInt)

TInt Read ( TInt aPos,
const RMessagePtr2 & aMessage,
TDes8 & aDes,
TInt aOffset = 0
)

Read and kill the client if it leaves.

Copies data from the client thread's address space into an 8 bit descriptor in the server address space. The source data must be a valid descriptor. Data is copied from the specified offset position within the source descriptor data area. The length of data copied is the length of source descriptor data minus the offset value. If the offset value is greater than the length of the source descriptor, then no data is copied. The length of data copied is limited to the maximum length of the target descriptor.

panic
This function will panic the client if the ReadL() leaves

Parameters

TInt aPos
const RMessagePtr2 & aMessage
TDes8 & aDes An 8 bit descriptor in the server address space. This is the target of the copy operation.
TInt aOffset = 0 The offset from the start of the source descriptor data area from where copying is to begin. This value must be greater than or equal to zero.

Read(TInt, const RMessagePtr2 &, TDes16 &, TInt)

TInt Read ( TInt aPos,
const RMessagePtr2 & aMessage,
TDes16 & aDes,
TInt aOffset = 0
)

Read and kill the client if it leaves.

(see CCommSession::Write() with 8-bit descriptor)

panic
This function will panic the client if the ReadL() leaves

Parameters

TInt aPos
const RMessagePtr2 & aMessage
TDes16 & aDes A 16 bit descriptor in the server address space. This is the target of the copy operation.
TInt aOffset = 0 The offset from the start of the source descriptor data area from where copying is to begin. This value must be greater than or equal to zero.

RemoveCSYFromSession(const TDesC &, TBool &)

TInt RemoveCSYFromSession ( const TDesC & aCSYFileName,
TBool & aIsLast
)

Parameters

const TDesC & aCSYFileName
TBool & aIsLast

RemovePlayerFromDisconnectList(CommsFW::TWorkerId)

void RemovePlayerFromDisconnectList ( CommsFW::TWorkerId aPlayerId ) [private]

Parameters

CommsFW::TWorkerId aPlayerId

SafeComplete(const RMessagePtr2 &, TInt)

void SafeComplete ( const RMessagePtr2 & aMessage,
TInt aCompletionCode
) [protected]

Parameters

const RMessagePtr2 & aMessage
TInt aCompletionCode

ServiceError(const RMessage2 &, TInt)

void ServiceError ( const RMessage2 & aMessage,
TInt aError
) [virtual]

Parameters

const RMessage2 & aMessage
TInt aError

ServiceL(const RMessage2 &)

void ServiceL ( const RMessage2 & aMessage ) [virtual]

Handle messages for this session.

Parameters

const RMessage2 & aMessage handle to the IPC message from the client

SessionCloseResp(CommsFW::TWorkerId)

void SessionCloseResp ( CommsFW::TWorkerId aPlayerId )

Parameters

CommsFW::TWorkerId aPlayerId

SubSessionFromHandle(TUint, CCommSubSession::TSubSessionType)

CCommSubSession * SubSessionFromHandle ( TUint aHandle,
CCommSubSession::TSubSessionType aType
) const [private]

SubSessions()

CC32SubSessionIx & SubSessions ( ) [inline]

WorkerId()

CommsFW::TWorkerId WorkerId ( ) const

Write(TInt, const RMessagePtr2 &, const TDesC8 &, TInt)

TInt Write ( TInt aPos,
const RMessagePtr2 & aMessage,
const TDesC8 & aDes,
TInt aOffset = 0
)

Write and kill the client if it leaves.

Copies data from an 8 bit descriptor in the server address space to the client thread's address space. The target location must be a valid modifiable descriptor. Data is copied from the source descriptor to the specified offset position within the target descriptor data area. The length of data copied is the length of the source descriptor. The length of the target descriptor is set to the length of the source descriptor plus the value of the offset.

panic
This function will panic the client if the WriteL() leaves

Parameters

TInt aPos
const RMessagePtr2 & aMessage
const TDesC8 & aDes An 8 bit descriptor in the server address space. This is the source of the copy operation.
TInt aOffset = 0 The offset from the start of the target descriptor data area where copying is to begin. This value must be greater than or equal to zero.

Write(TInt, const RMessagePtr2 &, const TDesC16 &, TInt)

TInt Write ( TInt aPos,
const RMessagePtr2 & aMessage,
const TDesC16 & aDes,
TInt aOffset = 0
)

Write and kill the client if it leaves.

(see CCommSession::Write() with 8-bit descriptor)

panic
This function will panic the client if the WriteL() leaves

Parameters

TInt aPos
const RMessagePtr2 & aMessage
const TDesC16 & aDes A 16 bit descriptor in the server address space. This is the source of the copy operation.
TInt aOffset = 0 The offset from the start of the target descriptor data area where copying is to begin. This value must be greater than or equal to zero.

Member Type Definitions Documentation

Typedef RCSYFileNameContainer

typedef RPointerArray < HBufC > RCSYFileNameContainer

Typedef TSubSessionProcessor

typedef void(* TSubSessionProcessor

Typedef inherited

typedef CSession2 inherited [private]

Member Data Documentation

TBool iComplete

TBool iComplete [private]

RCSYFileNameContainer iCsyCon

RCSYFileNameContainer iCsyCon [private]

RMessage2 iDisconnectMessage

RMessage2 iDisconnectMessage [private]

TUint32 iDisconnectPlayers

TUint32 iDisconnectPlayers [private]

CC32SessionCloseTimer * iSessionCloseTimer

CC32SessionCloseTimer * iSessionCloseTimer [private]

Timer starting when SessionClosed message is sent to players. If not all the expected responses come back within the deadline set in the Session Close message, the CC32SessionCloseTimer will fire and the session will be deleted by the Dealer. This is usually due to a Player somehow being unreliable and shouldn't normally happen. The purpose of the timeout is to avoid blocking clients.

CC32SubSessionIx iSubSessions

CC32SubSessionIx iSubSessions [private]

CC32ThreadManager * iThreadManager

CC32ThreadManager * iThreadManager [private]