RInternalSocket Class Reference

class RInternalSocket

A socket intended for use by components running inside the ESOCKV3 server, either within one thread or between threads. Currently, rather than interfacing with esock after the client-server interface (esock wouldn't support this without modification), we just pretend to be esock from the protocol below's point of view.

Note:

This implementation *does not* support the use of RMBufChains by clients if the protocol only provides a descriptor interface (and because of the mbuf<->des shim provided by esock, we can never tell that it won't work, but no data will be returned to the client)

Complete implementation as like RSocket
Public Member Functions
RInternalSocket()
~RInternalSocket()
IMPORT_C voidAccept(RInternalSocket &, TRequestStatus &)
IMPORT_C voidAccept(RInternalSocket &, TDes8 &, TRequestStatus &)
IMPORT_C TIntBind(TSockAddr &)
IMPORT_C voidCancelAccept()
IMPORT_C voidCancelAll()
IMPORT_C voidCancelConnect()
IMPORT_C voidCancelIoctl()
IMPORT_C voidCancelRead()
IMPORT_C voidCancelRecv()
IMPORT_C voidCancelSend()
IMPORT_C voidCancelWrite()
IMPORT_C voidClose()
IMPORT_C voidConnect(TSockAddr &, TRequestStatus &)
IMPORT_C voidConnect(TSockAddr &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TIntGetDisconnectData(TDes8 &)
IMPORT_C TIntGetOpt(TUint, TUint, TDes8 &)
IMPORT_C TIntGetOpt(TUint, TUint, TInt &)
IMPORT_C TIntInfo(TProtocolDesc &)
IMPORT_C voidIoctl(TUint, TRequestStatus &, TDes8 *, TUint)
IMPORT_C TIntListen(TUint)
IMPORT_C TIntListen(TUint, const TDesC8 &)
IMPORT_C voidLocalName(TSockAddr &)
IMPORT_C TUintLocalPort()
IMPORT_C TIntOpen(const TDesC &)
IMPORT_C TIntOpen(TUint, TUint, TUint)
IMPORT_C TIntOpen()
IMPORT_C voidOpen(const TDesC &, TRequestStatus &)
IMPORT_C voidOpen(TUint, TUint, TUint, TRequestStatus &)
IMPORT_C voidRead(TDes8 &, TRequestStatus &)
IMPORT_C voidRead(RMBufChain &, TRequestStatus &)
IMPORT_C voidRecv(TDes8 &, TUint, TRequestStatus &)
IMPORT_C voidRecv(RMBufChain &, TUint, TRequestStatus &)
IMPORT_C voidRecv(TDes8 &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidRecv(RMBufChain &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidRecvFrom(TDes8 &, TSockAddr &, TUint, TRequestStatus &)
IMPORT_C voidRecvFrom(RMBufChain &, TSockAddr &, TUint, TRequestStatus &)
IMPORT_C voidRecvFrom(TDes8 &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidRecvFrom(RMBufChain &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidRecvOneOrMore(TDes8 &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidRemoteName(TSockAddr &)
IMPORT_C voidSend(const TDesC8 &, TUint, TRequestStatus &)
IMPORT_C voidSend(RMBufChain &, TUint, TRequestStatus &)
IMPORT_C voidSend(const TDesC8 &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidSend(RMBufChain &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidSendTo(const TDesC8 &, TSockAddr &, TUint, TRequestStatus &)
IMPORT_C voidSendTo(RMBufChain &, TSockAddr &, TUint, TRequestStatus &)
IMPORT_C voidSendTo(const TDesC8 &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C voidSendTo(RMBufChain &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)
IMPORT_C TIntSetLocalPort(TInt)
IMPORT_C TIntSetOpt(TUint, TUint, const TDesC8 &)
IMPORT_C TIntSetOpt(TUint, TUint, TInt)
IMPORT_C voidShutdown(RSocket::TShutdown, TRequestStatus &)
IMPORT_C voidShutdown(RSocket::TShutdown, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TIntTransfer(RInternalSocket &)
IMPORT_C voidWrite(const TDesC8 &, TRequestStatus &)
IMPORT_C voidWrite(RMBufChain &, TRequestStatus &)
Private Member Functions
TInt AdoptBlankSocketToCurrentThread(RInternalSocket &)
CInternalSocketImpl *Implementation()
voidSetImplementation(CInternalSocketImpl *)
Private Attributes
CInternalSocketImpl *iImplementation

Constructor & Destructor Documentation

RInternalSocket()

IMPORT_CRInternalSocket()

~RInternalSocket()

IMPORT_C~RInternalSocket()

Member Functions Documentation

Accept(RInternalSocket &, TRequestStatus &)

IMPORT_C voidAccept(RInternalSocket &aBlankSocket,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RInternalSocket & aBlankSocket
TRequestStatus & aStatus

Accept(RInternalSocket &, TDes8 &, TRequestStatus &)

IMPORT_C voidAccept(RInternalSocket &aBlankSocket,
TDes8 &aConnectData,
TRequestStatus &aStatus
)

Parameters

RInternalSocket & aBlankSocket
TDes8 & aConnectData
TRequestStatus & aStatus

AdoptBlankSocketToCurrentThread(RInternalSocket &)

TInt AdoptBlankSocketToCurrentThread(RInternalSocket &aBlankSocket)[private]

Parameters

RInternalSocket & aBlankSocket

Bind(TSockAddr &)

IMPORT_C TIntBind(TSockAddr &aAddr)

RSocket documentation

Parameters

TSockAddr & aAddr

CancelAccept()

IMPORT_C voidCancelAccept()

RSocket documentation

CancelAll()

IMPORT_C voidCancelAll()

RSocket documentation

CancelConnect()

IMPORT_C voidCancelConnect()

RSocket documentation

CancelIoctl()

IMPORT_C voidCancelIoctl()

RSocket documentation

CancelRead()

IMPORT_C voidCancelRead()

RSocket documentation

CancelRecv()

IMPORT_C voidCancelRecv()

RSocket documentation

CancelSend()

IMPORT_C voidCancelSend()

RSocket documentation

CancelWrite()

IMPORT_C voidCancelWrite()

RSocket documentation

Close()

IMPORT_C voidClose()

RSocket documentation

Connect(TSockAddr &, TRequestStatus &)

IMPORT_C voidConnect(TSockAddr &aAddr,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

TSockAddr & aAddr
TRequestStatus & aStatus

Connect(TSockAddr &, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C voidConnect(TSockAddr &aAddr,
const TDesC8 &aConnectDataOut,
TDes8 &aConnectDataIn,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

TSockAddr & aAddr
const TDesC8 & aConnectDataOut
TDes8 & aConnectDataIn
TRequestStatus & aStatus

GetDisconnectData(TDes8 &)

IMPORT_C TIntGetDisconnectData(TDes8 &aDesc)

RSocket documentation

Parameters

TDes8 & aDesc

GetOpt(TUint, TUint, TDes8 &)

IMPORT_C TIntGetOpt(TUintaOptionName,
TUintaOptionLevel,
TDes8 &aOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TDes8 & aOption

GetOpt(TUint, TUint, TInt &)

IMPORT_C TIntGetOpt(TUintaOptionName,
TUintaOptionLevel,
TInt &aOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TInt & aOption

Implementation()

CInternalSocketImpl *Implementation()[private, inline]

Info(TProtocolDesc &)

IMPORT_C TIntInfo(TProtocolDesc &aProtocol)

RSocket documentation

Parameters

TProtocolDesc & aProtocol

Ioctl(TUint, TRequestStatus &, TDes8 *, TUint)

IMPORT_C voidIoctl(TUintaCommand,
TRequestStatus &aStatus,
TDes8 *aDesc = NULL,
TUintaLevel =  KLevelUnspecified
)

RSocket documentation

Parameters

TUint aCommand
TRequestStatus & aStatus
TDes8 * aDesc = NULL
TUint aLevel =  KLevelUnspecified

Listen(TUint)

IMPORT_C TIntListen(TUintaQSize)

RSocket documentation

Parameters

TUint aQSize

Listen(TUint, const TDesC8 &)

IMPORT_C TIntListen(TUintaQSize,
const TDesC8 &aConnectData
)

RSocket documentation

Parameters

TUint aQSize
const TDesC8 & aConnectData

LocalName(TSockAddr &)

IMPORT_C voidLocalName(TSockAddr &aAddr)

RSocket documentation

Parameters

TSockAddr & aAddr

LocalPort()

IMPORT_C TUintLocalPort()

RSocket documentation

Open(const TDesC &)

IMPORT_C TIntOpen(const TDesC &aName)

Special Open() for this class to mimic RSocket, but without the socket server session being required With the asynchronous nature of COMMS FW this API might cause deadlock scenario, hence this API is deprecated and asynchrnous version is provided.

RInternalSocket::Open(const TDesC& aName, TRequestStatus& aStatus)from 9.5 RSocket documentation

Parameters

const TDesC & aName

Open(TUint, TUint, TUint)

IMPORT_C TIntOpen(TUintaAddrFamily,
TUintaSockType,
TUintaProtocol
)

Special Open() for this class to mimic RSocket, but without the socket server session being required With the asynchronous nature of COMMS FW this API might cause deadlock scenario, hence this API is deprecated and asynchrnous version is provided.

RInternalSocket::Open(TUint aAddrFamily,TUint aSockType,TUint aProtocol, TRequestStatus& aStatus) RSocket documentation

Parameters

TUint aAddrFamily
TUint aSockType
TUint aProtocol

Open()

IMPORT_C TIntOpen()

Special Open() for this class to mimic RSocket, but without the socket server session being required RSocket documentation

Open(const TDesC &, TRequestStatus &)

IMPORT_C voidOpen(const TDesC &aName,
TRequestStatus &aStatus
)

Parameters

const TDesC & aName
TRequestStatus & aStatus

Open(TUint, TUint, TUint, TRequestStatus &)

IMPORT_C voidOpen(TUintaAddrFamily,
TUintaSockType,
TUintaProtocol,
TRequestStatus &aStatus
)

Parameters

TUint aAddrFamily
TUint aSockType
TUint aProtocol
TRequestStatus & aStatus

Read(TDes8 &, TRequestStatus &)

IMPORT_C voidRead(TDes8 &aDesc,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

TDes8 & aDesc
TRequestStatus & aStatus

Read(RMBufChain &, TRequestStatus &)

IMPORT_C voidRead(RMBufChain &aData,
TRequestStatus &aStatus
)
RSocket documentation
Note:

Pass in an empty (ie. no mbufs attached) RMBuf chain here - the mbufs will be attached by the protocol

Parameters

RMBufChain & aData
TRequestStatus & aStatus

Recv(TDes8 &, TUint, TRequestStatus &)

IMPORT_C voidRecv(TDes8 &aDesc,
TUintaFlags,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

TDes8 & aDesc
TUint aFlags
TRequestStatus & aStatus

Recv(RMBufChain &, TUint, TRequestStatus &)

IMPORT_C voidRecv(RMBufChain &aData,
TUintaFlags,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus

Recv(TDes8 &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidRecv(TDes8 &aDesc,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

TDes8 & aDesc
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

Recv(RMBufChain &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidRecv(RMBufChain &aData,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

RecvFrom(TDes8 &, TSockAddr &, TUint, TRequestStatus &)

IMPORT_C voidRecvFrom(TDes8 &aDesc,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus
)

Parameters

TDes8 & aDesc
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

RecvFrom(RMBufChain &, TSockAddr &, TUint, TRequestStatus &)

IMPORT_C voidRecvFrom(RMBufChain &aData,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

RecvFrom(TDes8 &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidRecvFrom(TDes8 &aDesc,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

TDes8 & aDesc
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

RecvFrom(RMBufChain &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidRecvFrom(RMBufChain &aData,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

RecvOneOrMore(TDes8 &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidRecvOneOrMore(TDes8 &aDesc,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

RSocket documentation.Note: This API is not having a RMBufChain variant as a RIS::Recv with RMBufChain will give the exact behaviour

Parameters

TDes8 & aDesc
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

RemoteName(TSockAddr &)

IMPORT_C voidRemoteName(TSockAddr &aAddr)

RSocket documentation

Parameters

TSockAddr & aAddr

Send(const TDesC8 &, TUint, TRequestStatus &)

IMPORT_C voidSend(const TDesC8 &aDesc,
TUintaFlags,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

const TDesC8 & aDesc
TUint aFlags
TRequestStatus & aStatus

Send(RMBufChain &, TUint, TRequestStatus &)

IMPORT_C voidSend(RMBufChain &aData,
TUintaFlags,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus

Send(const TDesC8 &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidSend(const TDesC8 &aDesc,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

RSocket documentation

Parameters

const TDesC8 & aDesc
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

Send(RMBufChain &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidSend(RMBufChain &aData,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

SendTo(const TDesC8 &, TSockAddr &, TUint, TRequestStatus &)

IMPORT_C voidSendTo(const TDesC8 &aDesc,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus
)

Parameters

const TDesC8 & aDesc
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

SendTo(RMBufChain &, TSockAddr &, TUint, TRequestStatus &)

IMPORT_C voidSendTo(RMBufChain &aData,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

SendTo(const TDesC8 &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidSendTo(const TDesC8 &aDesc,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

const TDesC8 & aDesc
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

SendTo(RMBufChain &, TSockAddr &, TUint, TRequestStatus &, TSockXfrLength &)

IMPORT_C voidSendTo(RMBufChain &aData,
TSockAddr &aAddr,
TUintaFlags,
TRequestStatus &aStatus,
TSockXfrLength &aLen
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

SetImplementation(CInternalSocketImpl *)

voidSetImplementation(CInternalSocketImpl *aImplementation)[private, inline]

Parameters

CInternalSocketImpl * aImplementation

SetLocalPort(TInt)

IMPORT_C TIntSetLocalPort(TIntaPort)

RSocket documentation

Parameters

TInt aPort

SetOpt(TUint, TUint, const TDesC8 &)

IMPORT_C TIntSetOpt(TUintaOptionName,
TUintaOptionLevel,
const TDesC8 &aOption =  TPtrC8(NULL, 0)
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
const TDesC8 & aOption =  TPtrC8(NULL, 0)

SetOpt(TUint, TUint, TInt)

IMPORT_C TIntSetOpt(TUintaOptionName,
TUintaOptionLevel,
TIntaOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TInt aOption

Shutdown(RSocket::TShutdown, TRequestStatus &)

IMPORT_C voidShutdown(RSocket::TShutdownaHow,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RSocket::TShutdown aHow
TRequestStatus & aStatus

Shutdown(RSocket::TShutdown, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C voidShutdown(RSocket::TShutdownaHow,
const TDesC8 &aDisconnectDataOut,
TDes8 &aDisconnectDataIn,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RSocket::TShutdown aHow
const TDesC8 & aDisconnectDataOut
TDes8 & aDisconnectDataIn
TRequestStatus & aStatus

Transfer(RInternalSocket &)

IMPORT_C TIntTransfer(RInternalSocket &aSource)
RSocket documentation
Note:

Rather than a two-stage Name(), Transfer(), this can be done in a single operation

Parameters

RInternalSocket & aSource

Write(const TDesC8 &, TRequestStatus &)

IMPORT_C voidWrite(const TDesC8 &aDesc,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

const TDesC8 & aDesc
TRequestStatus & aStatus

Write(RMBufChain &, TRequestStatus &)

IMPORT_C voidWrite(RMBufChain &aData,
TRequestStatus &aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TRequestStatus & aStatus

Member Data Documentation

CInternalSocketImpl * iImplementation

CInternalSocketImpl *iImplementation[private]