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()
voidCloseCommModuleL(const RMessage2 &)
voidCompleteDisconnect()
voidConstructL()
voidCountSubSessions(CCommSession *, CCommSubSession *, TInt, TAny *)
const CC32Dealer &Dealer()
TInt DisconnectPlayers()
TInt ExtractPortNameAndNumber(const RMessagePtr2 &, TDes &, TUint &, TInt &)
voidForgetSubSession(CCommSession *, CCommSubSession *, TInt, TAny *)
TBool IsDisconnectListEmpty()
TBool IsPlayerInDisconnectList(CommsFW::TWorkerId)
voidLoadCommModuleL(const RMessage2 &, CommsFW::TWorkerId, TBool, const TDesC &)
CCommSession *NewL(CC32ThreadManager *)
voidNewPortL(const RMessage2 &)
voidNumPorts(const RMessage2 &)
voidPortInfo(const RMessage2 &, TInt)
voidPortInfoL(const RMessage2 &, const TPortName &)
voidProcessSubSessions(CommsFW::TWorkerId, TSubSessionProcessor, TAny *)
TInt Read(TInt, const RMessagePtr2 &, TDes8 &, TInt)
TInt Read(TInt, const RMessagePtr2 &, TDes16 &, TInt)
TInt RemoveCSYFromSession(const TDesC &, TBool &)
voidServiceError(const RMessage2 &, TInt)
voidServiceL(const RMessage2 &)
voidSessionCloseResp(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
voidDisconnect()
voidDisconnect(const RMessage2 &)
voidDontCompleteCurrentRequest()
voidForwardMessageL(const RMessage2 &, CCommSubSession *, CommsFW::TWorkerId)
voidForwardMessageL(const RMessage2 &, CCommSubSession &)
voidSafeComplete(const RMessagePtr2 &, TInt)
Private Member Functions
voidAddPlayerToDisconnectList(CommsFW::TWorkerId)
voidCloseSubSessionL(const RMessage2 &, CCommSubSession::TSubSessionType)
voidRemovePlayerFromDisconnectList(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
typedefvoid(* 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)

voidAddPlayerToDisconnectList(CommsFW::TWorkerIdaPlayerId)[private]

Parameters

CommsFW::TWorkerId aPlayerId

C32WorkerThread()

CC32WorkerThread &C32WorkerThread()const

CloseCommModuleL(const RMessage2 &)

voidCloseCommModuleL(const RMessage2 &aMessage)

Close a comm module

Parameters

const RMessage2 & aMessage

CloseSubSessionL(const RMessage2 &, CCommSubSession::TSubSessionType)

voidCloseSubSessionL(const RMessage2 &aMessage,
CCommSubSession::TSubSessionTypeaType
)[private]

Parameters

const RMessage2 & aMessage
CCommSubSession::TSubSessionType aType

CompleteDisconnect()

voidCompleteDisconnect()[inline]

ConstructL()

voidConstructL()

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

voidCountSubSessions(CCommSession *aSession,
CCommSubSession *aSubSession,
TIntaSubSessionHandle,
TAny *aArg
)[static]

Parameters

CCommSession * aSession
CCommSubSession * aSubSession
TInt aSubSessionHandle
TAny * aArg

Dealer()

const CC32Dealer &Dealer()const [inline]

Disconnect()

voidDisconnect()[protected]

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

Disconnect(const RMessage2 &)

voidDisconnect(const RMessage2 &aMessage)[protected, virtual]

Parameters

const RMessage2 & aMessage

DisconnectPlayers()

TInt DisconnectPlayers()

DontCompleteCurrentRequest()

voidDontCompleteCurrentRequest()[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 *)

voidForgetSubSession(CCommSession *aSession,
CCommSubSession *aSubSession,
TIntaSubSessionHandle,
TAny *aArg
)[static]

Parameters

CCommSession * aSession
CCommSubSession * aSubSession
TInt aSubSessionHandle
TAny * aArg

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

voidForwardMessageL(const RMessage2 &aMessage,
CCommSubSession *aSS,
CommsFW::TWorkerIdaWorker
)[protected]

Parameters

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

ForwardMessageL(const RMessage2 &, CCommSubSession &)

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

Parameters

const RMessage2 & aMessageIPC message received from client.
CCommSubSession & aSubSessSubsession that needs to deal with this message.

IsDisconnectListEmpty()

TBool IsDisconnectListEmpty()const

IsPlayerInDisconnectList(CommsFW::TWorkerId)

TBool IsPlayerInDisconnectList(CommsFW::TWorkerIdaPlayerId)const

Parameters

CommsFW::TWorkerId aPlayerId

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

voidLoadCommModuleL(const RMessage2 &aMessage,
CommsFW::TWorkerIdaWorker,
TBooldefaulted,
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 &)

voidNewPortL(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 & aMessagehandle to the IPC message from the client

NumPorts(const RMessage2 &)

voidNumPorts(const RMessage2 &aMessage)

Write back the number of CSYs loaded to the client

Parameters

const RMessage2 & aMessage

PortInfo(const RMessage2 &, TInt)

voidPortInfo(const RMessage2 &aMessage,
TIntaPortNum
)

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 aPortNumnumber of the port to get information about

PortInfoL(const RMessage2 &, const TPortName &)

voidPortInfoL(const RMessage2 &aMessage,
const TPortName &aPortName
)

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

Parameters

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

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

voidProcessSubSessions(CommsFW::TWorkerIdaPeerId,
TSubSessionProcessoraSubSessionProcessor,
TAny *aPtr
)

Parameters

CommsFW::TWorkerId aPeerId
TSubSessionProcessor aSubSessionProcessor
TAny * aPtr

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

TInt Read(TIntaPos,
const RMessagePtr2 &aMessage,
TDes8 &aDes,
TIntaOffset = 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 & aDesAn 8 bit descriptor in the server address space. This is the target of the copy operation.
TInt aOffset = 0The 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(TIntaPos,
const RMessagePtr2 &aMessage,
TDes16 &aDes,
TIntaOffset = 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 & aDesA 16 bit descriptor in the server address space. This is the target of the copy operation.
TInt aOffset = 0The 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)

voidRemovePlayerFromDisconnectList(CommsFW::TWorkerIdaPlayerId)[private]

Parameters

CommsFW::TWorkerId aPlayerId

SafeComplete(const RMessagePtr2 &, TInt)

voidSafeComplete(const RMessagePtr2 &aMessage,
TIntaCompletionCode
)[protected]

Parameters

const RMessagePtr2 & aMessage
TInt aCompletionCode

ServiceError(const RMessage2 &, TInt)

voidServiceError(const RMessage2 &aMessage,
TIntaError
)[virtual]

Parameters

const RMessage2 & aMessage
TInt aError

ServiceL(const RMessage2 &)

voidServiceL(const RMessage2 &aMessage)[virtual]

Handle messages for this session.

Parameters

const RMessage2 & aMessagehandle to the IPC message from the client

SessionCloseResp(CommsFW::TWorkerId)

voidSessionCloseResp(CommsFW::TWorkerIdaPlayerId)

Parameters

CommsFW::TWorkerId aPlayerId

SubSessionFromHandle(TUint, CCommSubSession::TSubSessionType)

CCommSubSession *SubSessionFromHandle(TUintaHandle,
CCommSubSession::TSubSessionTypeaType
)const [private]

Parameters

TUint aHandle
CCommSubSession::TSubSessionType aType

SubSessions()

CC32SubSessionIx &SubSessions()[inline]

WorkerId()

CommsFW::TWorkerId WorkerId()const

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

TInt Write(TIntaPos,
const RMessagePtr2 &aMessage,
const TDesC8 &aDes,
TIntaOffset = 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 & aDesAn 8 bit descriptor in the server address space. This is the source of the copy operation.
TInt aOffset = 0The 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(TIntaPos,
const RMessagePtr2 &aMessage,
const TDesC16 &aDes,
TIntaOffset = 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 & aDesA 16 bit descriptor in the server address space. This is the source of the copy operation.
TInt aOffset = 0The 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]