ESock::CTransportFlowShim Class Reference

class ESock::CTransportFlowShim : public ESock::CNetworkFlow

Service Access Point Shim to convert CServProviderBase objects to CControlledServProvider objects.

Provides transport services to a single protocol. Several of the calls to CServProviderBase have pre-conditions attached to them - for example a connection oriented protocol must have its local address set (either by a SetLocalName() or AutoBind() ) before it is opened. If the socket server calls the CServProviderBase in such an erroneous way, the protocol should panic.

Since 9.0

Public Member Functions
CTransportFlowShim * NewL ( CSubConnectionFlowFactoryBase &, const Messages::TNodeId &, CProtocolIntfBase *)
CServProviderBase * Provider ()
void SetSSP ( CServProviderBase &)
Protected Member Functions
CTransportFlowShim ( CSubConnectionFlowFactoryBase &, const Messages::TNodeId &, CProtocolIntfBase *)
~CTransportFlowShim ()
void ActiveOpen ()
void BindToL ( TCFDataClient::TBindTo &)
CSubConnectionFlowBase & CloneFlowL ()
TInt Control ( TUint , TUint , TDes8 &)
void Destroy ()
void ExtractSetOptExtensions ()
MSessionControl * GetControlL ( TInt , MSessionControlNotify &)
MLowerControl * GetControlL (const TDesC8 &)
void GetData ( TDes8 &, TUint , TSockAddr *)
void Ioctl ( TUint , TUint , TDes8 *)
TInt LockToConnectionInfo ()
const Messages::TNodeId & NodeId ()
TInt PassiveOpen ( TUint )
void ReceivedL (const Messages::TRuntimeCtxId &, const Messages::TNodeId &, Messages::TSignatureBase &)
void Rejoin (const TCFFlow::TRejoin &)
EDataClientRoutedGuard EShuttingDown EBearerExpected SAP_FLAG_FUNCTIONS (DeleteUponBearerReception, EDeleteUponBearerReception)
TInt SecurityCheck ( MProvdSecurityChecker *)
MLowerDataSender::TSendResult Send ( RMBufChain &)
void SetBearerExpected ()
void SetDataClientRoutedGuard ()
void SetDeleteUponBearerReception ()
void SetDetaching ()
void SetFlowParamsInitialised ()
void SetLocalName ( TSockAddr &)
TInt SetOption ( TUint , TUint , const TDesC8 &)
void SetProtocolOptions ()
TInt SetRemName ( TSockAddr &)
void SetSockType ( TUint )
void Shutdown ( MSessionControl::TCloseType )
void Shutdown ( MSessionControl::TCloseType , const TDesC8 &)
TBool ShuttingDown ()
void Start ()
void StartFlowL (const Messages::TRuntimeCtxId &)
void StopFlow ( TCFDataClient::TStop &)
TBool Stopped ()
void StoreProvision ( TCFDataClient::TProvisionConfig &)
void SubConnectionError (const Messages::TEBase::TError &, TUint )
void Unbind ()
void Unbind ( MUpperDataReceiver *, MUpperControl *)
TBool UseBearerErrors ()
TUint Write (const TDesC8 &, TUint , TSockAddr *)
TInt Write ( RMBufChain &, TUint , TSockAddr *)
Private Member Functions
void CanClose ( MSocketNotify::TDelete )
void CanClose (const TDesC8 &, MSocketNotify::TDelete )
CTransportFlowShim * CloneNSetSAP ( CServProviderBase &)
void CompleteStart ( TInt )
void ConnectComplete ()
void ConnectComplete (const TDesC8 &)
void ConnectComplete ( CServProviderBase &)
void ConnectComplete ( CServProviderBase &, const TDesC8 &)
void Disconnect (void)
TBool DoNoBearer ()
void Error ( TInt , TUint )
void InitDestroy ()
void IoctlComplete ( TDesC8 *)
void NewData ( TUint )
void NoBearer (const TDesC8 &)
void NoBearerCompletion ()
void PostDataClientRouted ()
void PostNoBearer ()
void SetFlowParams (const TFlowParams &)
void SetLocalNameProcess ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
ESock::CCommsProviderBase::AccessPointConfig()const
ESock::CCommsProviderBase::~CCommsProviderBase()
ESock::CNetworkFlow::BindToL(const TCFDataClient::TBindTo &)
ESock::CNetworkFlow::CNetworkFlow(CSubConnectionFlowFactoryBase &,const Messages::TNodeId &,CProtocolIntfBase *)
ESock::CNetworkFlow::ClearIdle()
ESock::CNetworkFlow::ClearIdleSent()
ESock::CNetworkFlow::ClearLocalAddressSet()
ESock::CNetworkFlow::ClearNoBearerGuard()
ESock::CNetworkFlow::ClearRemoteAddressSet()
ESock::CNetworkFlow::ClearStarted()
ESock::CNetworkFlow::DoGetBinderControlL()
ESock::CNetworkFlow::FetchInterfaceControlL(TSupportedCommsApiExt)
ESock::CNetworkFlow::Flow()
ESock::CNetworkFlow::Idle()
ESock::CNetworkFlow::IdleSent()
ESock::CNetworkFlow::IsBoundToSession()const
ESock::CNetworkFlow::LocalAddressSet()
ESock::CNetworkFlow::NoBearerGuard()
ESock::CNetworkFlow::ProcessDCIdleState()
ESock::CNetworkFlow::RemoteAddressSet()
ESock::CNetworkFlow::SetIdle()
ESock::CNetworkFlow::SetIdleSent()
ESock::CNetworkFlow::SetLocalAddressSet()
ESock::CNetworkFlow::SetNoBearerGuard()
ESock::CNetworkFlow::SetRemoteAddressSet()
ESock::CNetworkFlow::SetStarted()
ESock::CNetworkFlow::Started()
ESock::CNetworkFlow::UpdateDestinationAddress(const TSockAddr &)
ESock::CNetworkFlow::~CNetworkFlow()
ESock::CSubConnectionFlowBase::CSubConnectionFlowBase(CSubConnectionFlowFactoryBase &,const Messages::TNodeId &,CProtocolIntfBase *)
ESock::CSubConnectionFlowBase::ControlProvider()const
ESock::CSubConnectionFlowBase::DeleteThisFlow()
ESock::CSubConnectionFlowBase::Factory()const
ESock::CSubConnectionFlowBase::FetchNodeInterfaceControlL(TInt)
ESock::CSubConnectionFlowBase::GetBinderControlL()
ESock::CSubConnectionFlowBase::HasControlPlane()const
ESock::CSubConnectionFlowBase::ProtocolIntf()const
ESock::CSubConnectionFlowBase::SubConnectionGoingDown()
ESock::CSubConnectionFlowBase::~CSubConnectionFlowBase()
Protected Member Enumerations
enum TStateFlag {
EDetaching  = 0x0001000, EDataClientRoutedGuard  = 0x00020000, EStopped  = 0x00040000, EShuttingDown  = 0x00080000, EFlowParamsInitialised  = 0x00100000, EBearerExpected  = 0x00200000, EDeleteUponBearerReception  = 0x00400000, EUseBearerErrors  = 0x00800000
}
Public Member Type Definitions
typedef CTransportFlowShimFactory FactoryType
Private Attributes
TFlowParams iFlowParams
MUpperControl * iHostResolverNotify
TSoIfConnectionInfo iIfInfo
MSessionControlNotify * iListenerControlNotify
CProtocolRef * iProtocolReference
CServProviderBase * iProvider
Messages::RRequestOriginator iStartRequest
Inherited Attributes
ESock::CCommsProviderBase::iAccessPointConfig
ESock::CNetworkFlow::iLocalAddress
ESock::CNetworkFlow::iLowerControl
ESock::CNetworkFlow::iLowerFlow
ESock::CNetworkFlow::iRemoteAddress
ESock::CNetworkFlow::iSessionControlNotify
ESock::CNetworkFlow::iSessionDataNotify
ESock::CNetworkFlow::iStateFlags
ESock::CSubConnectionFlowBase::iLastRequestOriginator
ESock::CSubConnectionFlowBase::iProtocolIntf
ESock::CSubConnectionFlowBase::iSubConnectionProvider

Constructor & Destructor Documentation

CTransportFlowShim(CSubConnectionFlowFactoryBase &, const Messages::TNodeId &, CProtocolIntfBase *)

CTransportFlowShim ( CSubConnectionFlowFactoryBase & aFactory,
const Messages::TNodeId & aSubConn,
CProtocolIntfBase * aProtocolIntf
) [protected]

Parameters

CSubConnectionFlowFactoryBase & aFactory
const Messages::TNodeId & aSubConn
CProtocolIntfBase * aProtocolIntf

~CTransportFlowShim()

~CTransportFlowShim ( ) [protected, virtual]

Member Functions Documentation

ActiveOpen()

void ActiveOpen ( ) [protected, virtual]

BindToL(TCFDataClient::TBindTo &)

void BindToL ( TCFDataClient::TBindTo & aBindTo ) [protected]

Request from control side (at network layer) to indicate that the SubConnection is up and running and that we should bind to a Flow below.

Parameters

TCFDataClient::TBindTo & aBindTo

CanClose(MSocketNotify::TDelete)

void CanClose ( MSocketNotify::TDelete aDelete = MSocketNotify::EDelete ) [private, virtual]

Parameters

MSocketNotify::TDelete aDelete = MSocketNotify::EDelete

CanClose(const TDesC8 &, MSocketNotify::TDelete)

void CanClose ( const TDesC8 & aDisconnectData,
MSocketNotify::TDelete aDelete = MSocketNotify::EDelete
) [private, virtual]

Parameters

const TDesC8 & aDisconnectData
MSocketNotify::TDelete aDelete = MSocketNotify::EDelete

CloneFlowL()

CSubConnectionFlowBase & CloneFlowL ( ) [protected, virtual]

CloneNSetSAP(CServProviderBase &)

CTransportFlowShim * CloneNSetSAP ( CServProviderBase & aSSP ) [private]

Parameters

CServProviderBase & aSSP

CompleteStart(TInt)

void CompleteStart ( TInt aError ) [private]

Parameters

TInt aError

ConnectComplete()

void ConnectComplete ( ) [private, virtual]

ConnectComplete(const TDesC8 &)

void ConnectComplete ( const TDesC8 & aConnectData ) [private, virtual]

Parameters

const TDesC8 & aConnectData

ConnectComplete(CServProviderBase &)

void ConnectComplete ( CServProviderBase & aSSP ) [private, virtual]

Parameters

CServProviderBase & aSSP

ConnectComplete(CServProviderBase &, const TDesC8 &)

void ConnectComplete ( CServProviderBase & aSSP,
const TDesC8 & aConnectData
) [private, virtual]

Parameters

CServProviderBase & aSSP
const TDesC8 & aConnectData

Control(TUint, TUint, TDes8 &)

TInt Control ( TUint aLevel,
TUint aName,
TDes8 & aOption
) [protected, virtual]

Parameters

TUint aLevel
TUint aName
TDes8 & aOption

Destroy()

void Destroy ( ) [protected]

Disconnect(void)

void Disconnect ( void ) [private, virtual]

Parameters

void

DoNoBearer()

TBool DoNoBearer ( ) [private]

Do the actual no Bearer call.

Error(TInt, TUint)

void Error ( TInt anError,
TUint anOperationMask = MSocketNotify::EErrorAllOperations
) [private, virtual]

Parameters

TInt anError
TUint anOperationMask = MSocketNotify::EErrorAllOperations

ExtractSetOptExtensions()

void ExtractSetOptExtensions ( ) [protected]

GetControlL(TInt, MSessionControlNotify &)

MSessionControl * GetControlL ( TInt aSessionType,
MSessionControlNotify & aSessionControlNotify
) [protected, virtual]

Parameters

TInt aSessionType
MSessionControlNotify & aSessionControlNotify

GetControlL(const TDesC8 &)

MLowerControl * GetControlL ( const TDesC8 & aProtocol ) [protected, virtual]

Parameters

const TDesC8 & aProtocol

GetData(TDes8 &, TUint, TSockAddr *)

void GetData ( TDes8 & aDesc,
TUint aOptions,
TSockAddr * anAddr
) [protected, virtual]

Parameters

TDes8 & aDesc
TUint aOptions
TSockAddr * anAddr

InitDestroy()

void InitDestroy ( ) [private]

Ioctl(TUint, TUint, TDes8 *)

void Ioctl ( TUint aLevel,
TUint aName,
TDes8 * anOption
) [protected, virtual]

Performs some protocol specific IO control.

Note:

If this function is called erroneously, the protocol should call Error() on the socket. If an Ioctl call is already outstanding, the client will be panicked with the value ETwoIoctls.

Parameters

TUint aLevel Option level.
TUint aName Option name.
TDes8 * anOption Option data.

IoctlComplete(TDesC8 *)

void IoctlComplete ( TDesC8 * aBuf ) [private, virtual]

Parameters

TDesC8 * aBuf

LockToConnectionInfo()

TInt LockToConnectionInfo ( ) [protected]

NewData(TUint)

void NewData ( TUint aCount ) [private, virtual]

Parameters

TUint aCount

NewL(CSubConnectionFlowFactoryBase &, const Messages::TNodeId &, CProtocolIntfBase *)

CTransportFlowShim * NewL ( CSubConnectionFlowFactoryBase & aFactory,
const Messages::TNodeId & aSubConn,
CProtocolIntfBase * aProtocolIntf
) [static]

Parameters

CSubConnectionFlowFactoryBase & aFactory
const Messages::TNodeId & aSubConn
CProtocolIntfBase * aProtocolIntf

NoBearer(const TDesC8 &)

void NoBearer ( const TDesC8 & aConnectionParams ) [private, virtual]

Upcall from protocol indicating no underlying bearer for the socket.

Parameters

const TDesC8 & aConnectionParams Additional connection parameters from the stack, in the form of a human readable string. Initially, the required protocols (e.g. "protocol=ip").

NoBearerCompletion()

void NoBearerCompletion ( ) [private]

NodeId()

const Messages::TNodeId & NodeId ( ) const [protected, virtual]

PassiveOpen(TUint)

TInt PassiveOpen ( TUint aQueueSize ) [protected, virtual]

Tells the protocol to start waiting for an incoming connection request on this socket (i.e. port). It is called by the socket server in response to a listen request from a client.

Only ever called on connection-oriented sockets. Such a socket should always have both the local address and the remote address specified before this function is called. If this is not the case, then the protocol should panic.

The aQue parameter is the number of sockets which can be waiting for an outstanding Start after calling ConnectComplete() . The protocol should keep a count of sockets in this state - incrementing a variable in ConnectComplete() , and decrementing it in Start() .

When a connection has completed, the protocol should call ConnectComplete() on its TNotify. If an error occurs during connection the protocol should not call ConnectComplete() at all; instead it should call Error() .

Parameters

TUint aQueueSize

PostDataClientRouted()

void PostDataClientRouted ( ) [private]

PostNoBearer()

void PostNoBearer ( ) [private]

Provider()

CServProviderBase * Provider ( ) [inline]

ReceivedL(const Messages::TRuntimeCtxId &, const Messages::TNodeId &, Messages::TSignatureBase &)

void ReceivedL ( const Messages::TRuntimeCtxId & aSender,
const Messages::TNodeId & aRecipient,
Messages::TSignatureBase & aMessage
) [protected, virtual]

Parameters

const Messages::TRuntimeCtxId & aSender
const Messages::TNodeId & aRecipient
Messages::TSignatureBase & aMessage

Rejoin(const TCFFlow::TRejoin &)

void Rejoin ( const TCFFlow::TRejoin & aRejoinMessage ) [protected]

Parameters

const TCFFlow::TRejoin & aRejoinMessage

SAP_FLAG_FUNCTIONS(DeleteUponBearerReception, EDeleteUponBearerReception)

EDataClientRoutedGuard EShuttingDown EBearerExpected SAP_FLAG_FUNCTIONS ( DeleteUponBearerReception ,
EDeleteUponBearerReception
) [protected]

Parameters

DeleteUponBearerReception
EDeleteUponBearerReception

SecurityCheck(MProvdSecurityChecker *)

TInt SecurityCheck ( MProvdSecurityChecker * aSecurityChecker ) [protected, virtual]

Ask the SAP provider to perform a security policy check on the client process (default implementation).

Parameters

MProvdSecurityChecker * aSecurityChecker

Send(RMBufChain &)

MLowerDataSender::TSendResult Send ( RMBufChain & aData ) [protected, virtual]

Parameters

RMBufChain & aData

SetBearerExpected()

void SetBearerExpected ( ) [protected, inline]

SetDataClientRoutedGuard()

void SetDataClientRoutedGuard ( ) [protected, inline]

SetDeleteUponBearerReception()

void SetDeleteUponBearerReception ( ) [protected, inline]

SetDetaching()

void SetDetaching ( ) [protected, inline]

SetFlowParams(const TFlowParams &)

void SetFlowParams ( const TFlowParams & aFlowParams ) [private, inline]

Parameters

const TFlowParams & aFlowParams

SetFlowParamsInitialised()

void SetFlowParamsInitialised ( ) [protected, inline]

SetLocalName(TSockAddr &)

void SetLocalName ( TSockAddr & anAddr ) [protected, virtual]

Sets the local name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

Parameters

TSockAddr & anAddr The address

SetLocalNameProcess()

void SetLocalNameProcess ( ) [private]

SetOption(TUint, TUint, const TDesC8 &)

TInt SetOption ( TUint aLevel,
TUint aName,
const TDesC8 & anOption
) [protected, virtual]

Sets some protocol specific option when called by the socket server on behalf of a client. A protocol may pass the request down a protocol stack (to protocols it is bound to) using the SetOption() function of CProtocolBase .

Parameters

TUint aLevel Option level.
TUint aName Option name.
const TDesC8 & anOption Option data.

SetProtocolOptions()

void SetProtocolOptions ( ) [protected]

SetRemName(TSockAddr &)

TInt SetRemName ( TSockAddr & anAddr ) [protected, virtual]

Sets the remote name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

Parameters

TSockAddr & anAddr The address

SetSSP(CServProviderBase &)

void SetSSP ( CServProviderBase & aSSP )

Parameters

CServProviderBase & aSSP

SetSockType(TUint)

void SetSockType ( TUint aSockType ) [protected]

Parameters

TUint aSockType

Shutdown(MSessionControl::TCloseType)

void Shutdown ( MSessionControl::TCloseType aOption ) [protected, virtual]

Terminates a connection (or closes a non connection-oriented socket down).

The value of the option argument specifies the type of processing which will be required of the protocol after this function is called.

Normally, when the socket server has called Shutdown() for a socket, it will wait for the socket to call CanClose() before destroying the CServProviderBase object. However, if the option argument is EImmediate, the CServProviderBase will be destroyed as soon as Shutdown() returns.

Shutdown(MSessionControl::TCloseType, const TDesC8 &)

void Shutdown ( MSessionControl::TCloseType aOption,
const TDesC8 & aDisconnectionData
) [protected, virtual]

Parameters

MSessionControl::TCloseType aOption
const TDesC8 & aDisconnectionData

ShuttingDown()

TBool ShuttingDown ( ) [protected, inline]

Start()

void Start ( ) [protected, virtual]

Start a service provider.

StartFlowL(const Messages::TRuntimeCtxId &)

void StartFlowL ( const Messages::TRuntimeCtxId & aSender ) [protected]

Parameters

const Messages::TRuntimeCtxId & aSender

StopFlow(TCFDataClient::TStop &)

void StopFlow ( TCFDataClient::TStop & aMessage ) [protected]

Parameters

TCFDataClient::TStop & aMessage

Stopped()

TBool Stopped ( ) [protected, inline]

StoreProvision(TCFDataClient::TProvisionConfig &)

void StoreProvision ( TCFDataClient::TProvisionConfig & aMessage ) [protected]

Parameters

TCFDataClient::TProvisionConfig & aMessage

SubConnectionError(const Messages::TEBase::TError &, TUint)

void SubConnectionError ( const Messages::TEBase::TError & errorMsg,
TUint anOperationMask = (MSessionControlNotify::EErrorSend|MSessionControlNotify::EErrorConnect|MSessionControlNotify::EErrorCompleteSetLocalName)
) [protected]

Parameters

const Messages::TEBase::TError & errorMsg
TUint anOperationMask = (MSessionControlNotify::EErrorSend|MSessionControlNotify::EErrorConnect|MSessionControlNotify::EErrorCompleteSetLocalName)

Unbind()

void Unbind ( ) [protected, virtual]

Unbind(MUpperDataReceiver *, MUpperControl *)

void Unbind ( MUpperDataReceiver * aReceiver,
MUpperControl * aControl
) [protected, virtual]

Parameters

MUpperDataReceiver * aReceiver
MUpperControl * aControl

UseBearerErrors()

TBool UseBearerErrors ( ) [protected, inline]

Write(const TDesC8 &, TUint, TSockAddr *)

TUint Write ( const TDesC8 & aDesc,
TUint aOptions,
TSockAddr * anAddr
) [protected, virtual]

Sends data onto the network via the protocol.

Connection-oriented sockets must be in a connected state (that is ConnectComplete() has been called on their MSocketNotify before Write() is called).

The socket server keeps track of how much data is waiting and then tries to send it all until the protocol tells it to hold off by returning 0 (datagram sockets) or 'less than all data consumed' (stream sockets) to Write() . The protocol should call CanSend() when it is ready to send more data.

anAddr is the address to write the data to. Connection oriented sockets always use the default value.

Parameters

const TDesC8 & aDesc The data to be sent.
TUint aOptions Protocol specific options.
TSockAddr * anAddr Address to write the data to.

Write(RMBufChain &, TUint, TSockAddr *)

TInt Write ( RMBufChain & aData,
TUint aOptions,
TSockAddr * anAddr
) [protected, virtual]

Sends data onto the network via the protocol.

Connection-oriented sockets must be in a connected state (that is ConnectComplete() has been called on their MSocketNotify before Write() is called).

The socket server keeps track of how much data is waiting and then tries to send it all until the protocol tells it to hold off by returning 0 (datagram sockets) or 'less than all data consumed' (stream sockets) to Write() . The protocol should call CanSend() when it is ready to send more data.

anAddr is the address to write the data to. Connection oriented sockets always use the default value.

Parameters

RMBufChain & aData The data to be sent.
TUint aOptions Protocol specific options.
TSockAddr * anAddr Address to write the data to.

Member Enumerations Documentation

Enum TStateFlag

Enumerators

EDetaching = 0x0001000
EDataClientRoutedGuard = 0x00020000
EStopped = 0x00040000
EShuttingDown = 0x00080000
EFlowParamsInitialised = 0x00100000
EBearerExpected = 0x00200000
EDeleteUponBearerReception = 0x00400000
EUseBearerErrors = 0x00800000

Member Type Definitions Documentation

Typedef FactoryType

typedef CTransportFlowShimFactory FactoryType

Member Data Documentation

TFlowParams iFlowParams

TFlowParams iFlowParams [private]

MUpperControl * iHostResolverNotify

MUpperControl * iHostResolverNotify [private]

TSoIfConnectionInfo iIfInfo

TSoIfConnectionInfo iIfInfo [private]

MSessionControlNotify * iListenerControlNotify

MSessionControlNotify * iListenerControlNotify [private]

CProtocolRef * iProtocolReference

CProtocolRef * iProtocolReference [private]

CServProviderBase * iProvider

CServProviderBase * iProvider [private]

Messages::RRequestOriginator iStartRequest

Messages::RRequestOriginator iStartRequest [private]