CCommSession Class Reference
class CCommSession : public CSession2
|
A client session. Corresponds to an RCommSession object in the client.
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
)
|
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
|
|
)
|
|
AddPlayerToDisconnectList(CommsFW::TWorkerId)
void
|
AddPlayerToDisconnectList
|
(
|
CommsFW::TWorkerId
|
aPlayerId
|
)
|
[private]
|
Parameters
CommsFW::TWorkerId
aPlayerId
|
|
CloseCommModuleL(const RMessage2 &)
void
|
CloseCommModuleL
|
(
|
const
RMessage2
&
|
aMessage
|
)
|
|
CloseSubSessionL(const RMessage2 &, CCommSubSession::TSubSessionType)
CompleteDisconnect()
void
|
CompleteDisconnect
|
(
|
)
|
[inline]
|
CountSubSessions(CCommSession *, CCommSubSession *, TInt, TAny *)
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]
|
DisconnectPlayers()
TInt
|
DisconnectPlayers
|
(
|
)
|
|
DontCompleteCurrentRequest()
void
|
DontCompleteCurrentRequest
|
(
|
)
|
[protected]
|
ExtractPortNameAndNumber(const RMessagePtr2 &, TDes &, TUint &, TInt &)
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.
ForgetSubSession(CCommSession *, CCommSubSession *, TInt, TAny *)
ForwardMessageL(const RMessage2 &, CCommSubSession *, CommsFW::TWorkerId)
ForwardMessageL(const RMessage2 &, CCommSubSession &)
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
NewL(CC32ThreadManager *)
CCommSession
*
|
NewL
|
(
|
CC32ThreadManager *
|
aThreadManager
|
)
|
[static]
|
Parameters
CC32ThreadManager * aThreadManager
|
|
NewPortL(const RMessage2 &)
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 &)
Write back the number of CSYs loaded to the client
PortInfo(const RMessage2 &, TInt)
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 &)
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 *)
Read(TInt, const RMessagePtr2 &, TDes8 &, TInt)
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)
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
|
|
)
|
|
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]
|
ServiceError(const RMessage2 &, TInt)
void
|
ServiceError
|
(
|
const
RMessage2
&
|
aMessage,
|
|
TInt
|
aError
|
|
)
|
[virtual]
|
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)
WorkerId()
CommsFW::TWorkerId
|
WorkerId
|
(
|
)
|
const
|
Write(TInt, const RMessagePtr2 &, const TDesC8 &, TInt)
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)
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 TSubSessionProcessor
typedef void(*
|
TSubSessionProcessor
|
Member Data Documentation
TBool
iComplete
TBool
|
iComplete
|
[private]
|
RCSYFileNameContainer
iCsyCon
RMessage2
iDisconnectMessage
TUint32
iDisconnectPlayers
TUint32
|
iDisconnectPlayers
|
[private]
|
CC32SessionCloseTimer * iSessionCloseTimer
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
CC32ThreadManager * iThreadManager
CC32ThreadManager *
|
iThreadManager
|
[private]
|
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.