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 void Accept ( RInternalSocket &, TRequestStatus &)
IMPORT_C void Accept ( RInternalSocket &, TDes8 &, TRequestStatus &)
IMPORT_C TInt Bind ( TSockAddr &)
IMPORT_C void CancelAccept ()
IMPORT_C void CancelAll ()
IMPORT_C void CancelConnect ()
IMPORT_C void CancelIoctl ()
IMPORT_C void CancelRead ()
IMPORT_C void CancelRecv ()
IMPORT_C void CancelSend ()
IMPORT_C void CancelWrite ()
IMPORT_C void Close ()
IMPORT_C void Connect ( TSockAddr &, TRequestStatus &)
IMPORT_C void Connect ( TSockAddr &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TInt GetDisconnectData ( TDes8 &)
IMPORT_C TInt GetOpt ( TUint , TUint , TDes8 &)
IMPORT_C TInt GetOpt ( TUint , TUint , TInt &)
IMPORT_C TInt Info ( TProtocolDesc &)
IMPORT_C void Ioctl ( TUint , TRequestStatus &, TDes8 *, TUint )
IMPORT_C TInt Listen ( TUint )
IMPORT_C TInt Listen ( TUint , const TDesC8 &)
IMPORT_C void LocalName ( TSockAddr &)
IMPORT_C TUint LocalPort ()
IMPORT_C TInt Open (const TDesC &)
IMPORT_C TInt Open ( TUint , TUint , TUint )
IMPORT_C TInt Open ()
IMPORT_C void Open (const TDesC &, TRequestStatus &)
IMPORT_C void Open ( TUint , TUint , TUint , TRequestStatus &)
IMPORT_C void Read ( TDes8 &, TRequestStatus &)
IMPORT_C void Read ( RMBufChain &, TRequestStatus &)
IMPORT_C void Recv ( TDes8 &, TUint , TRequestStatus &)
IMPORT_C void Recv ( RMBufChain &, TUint , TRequestStatus &)
IMPORT_C void Recv ( TDes8 &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void Recv ( RMBufChain &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void RecvFrom ( TDes8 &, TSockAddr &, TUint , TRequestStatus &)
IMPORT_C void RecvFrom ( RMBufChain &, TSockAddr &, TUint , TRequestStatus &)
IMPORT_C void RecvFrom ( TDes8 &, TSockAddr &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void RecvFrom ( RMBufChain &, TSockAddr &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void RecvOneOrMore ( TDes8 &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void RemoteName ( TSockAddr &)
IMPORT_C void Send (const TDesC8 &, TUint , TRequestStatus &)
IMPORT_C void Send ( RMBufChain &, TUint , TRequestStatus &)
IMPORT_C void Send (const TDesC8 &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void Send ( RMBufChain &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void SendTo (const TDesC8 &, TSockAddr &, TUint , TRequestStatus &)
IMPORT_C void SendTo ( RMBufChain &, TSockAddr &, TUint , TRequestStatus &)
IMPORT_C void SendTo (const TDesC8 &, TSockAddr &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C void SendTo ( RMBufChain &, TSockAddr &, TUint , TRequestStatus &, TSockXfrLength &)
IMPORT_C TInt SetLocalPort ( TInt )
IMPORT_C TInt SetOpt ( TUint , TUint , const TDesC8 &)
IMPORT_C TInt SetOpt ( TUint , TUint , TInt )
IMPORT_C void Shutdown ( RSocket::TShutdown , TRequestStatus &)
IMPORT_C void Shutdown ( RSocket::TShutdown , const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TInt Transfer ( RInternalSocket &)
IMPORT_C void Write (const TDesC8 &, TRequestStatus &)
IMPORT_C void Write ( RMBufChain &, TRequestStatus &)
Private Member Functions
TInt AdoptBlankSocketToCurrentThread ( RInternalSocket &)
CInternalSocketImpl * Implementation ()
void SetImplementation (CInternalSocketImpl *)
Private Attributes
CInternalSocketImpl * iImplementation

Constructor & Destructor Documentation

RInternalSocket()

IMPORT_C RInternalSocket ( )

~RInternalSocket()

IMPORT_C ~RInternalSocket ( )

Member Functions Documentation

Accept(RInternalSocket &, TRequestStatus &)

IMPORT_C void Accept ( RInternalSocket & aBlankSocket,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

RInternalSocket & aBlankSocket
TRequestStatus & aStatus

Accept(RInternalSocket &, TDes8 &, TRequestStatus &)

IMPORT_C void Accept ( 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 TInt Bind ( TSockAddr & aAddr )

RSocket documentation

Parameters

TSockAddr & aAddr

CancelAccept()

IMPORT_C void CancelAccept ( )

RSocket documentation

CancelAll()

IMPORT_C void CancelAll ( )

RSocket documentation

CancelConnect()

IMPORT_C void CancelConnect ( )

RSocket documentation

CancelIoctl()

IMPORT_C void CancelIoctl ( )

RSocket documentation

CancelRead()

IMPORT_C void CancelRead ( )

RSocket documentation

CancelRecv()

IMPORT_C void CancelRecv ( )

RSocket documentation

CancelSend()

IMPORT_C void CancelSend ( )

RSocket documentation

CancelWrite()

IMPORT_C void CancelWrite ( )

RSocket documentation

Close()

IMPORT_C void Close ( )

RSocket documentation

Connect(TSockAddr &, TRequestStatus &)

IMPORT_C void Connect ( TSockAddr & aAddr,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

TSockAddr & aAddr
TRequestStatus & aStatus

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

IMPORT_C void Connect ( 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 TInt GetDisconnectData ( TDes8 & aDesc )

RSocket documentation

Parameters

TDes8 & aDesc

GetOpt(TUint, TUint, TDes8 &)

IMPORT_C TInt GetOpt ( TUint aOptionName,
TUint aOptionLevel,
TDes8 & aOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TDes8 & aOption

GetOpt(TUint, TUint, TInt &)

IMPORT_C TInt GetOpt ( TUint aOptionName,
TUint aOptionLevel,
TInt & aOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TInt & aOption

Implementation()

CInternalSocketImpl * Implementation ( ) [private, inline]

Info(TProtocolDesc &)

IMPORT_C TInt Info ( TProtocolDesc & aProtocol )

RSocket documentation

Parameters

TProtocolDesc & aProtocol

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

IMPORT_C void Ioctl ( TUint aCommand,
TRequestStatus & aStatus,
TDes8 * aDesc = NULL,
TUint aLevel =  KLevelUnspecified
)

RSocket documentation

Parameters

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

Listen(TUint)

IMPORT_C TInt Listen ( TUint aQSize )

RSocket documentation

Parameters

TUint aQSize

Listen(TUint, const TDesC8 &)

IMPORT_C TInt Listen ( TUint aQSize,
const TDesC8 & aConnectData
)

RSocket documentation

Parameters

TUint aQSize
const TDesC8 & aConnectData

LocalName(TSockAddr &)

IMPORT_C void LocalName ( TSockAddr & aAddr )

RSocket documentation

Parameters

TSockAddr & aAddr

LocalPort()

IMPORT_C TUint LocalPort ( )

RSocket documentation

Open(const TDesC &)

IMPORT_C TInt Open ( 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 TInt Open ( TUint aAddrFamily,
TUint aSockType,
TUint aProtocol
)

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 TInt Open ( )

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

Open(const TDesC &, TRequestStatus &)

IMPORT_C void Open ( const TDesC & aName,
TRequestStatus & aStatus
)

Parameters

const TDesC & aName
TRequestStatus & aStatus

Open(TUint, TUint, TUint, TRequestStatus &)

IMPORT_C void Open ( TUint aAddrFamily,
TUint aSockType,
TUint aProtocol,
TRequestStatus & aStatus
)

Parameters

TUint aAddrFamily
TUint aSockType
TUint aProtocol
TRequestStatus & aStatus

Read(TDes8 &, TRequestStatus &)

IMPORT_C void Read ( TDes8 & aDesc,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

TDes8 & aDesc
TRequestStatus & aStatus

Read(RMBufChain &, TRequestStatus &)

IMPORT_C void Read ( 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 void Recv ( TDes8 & aDesc,
TUint aFlags,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

TDes8 & aDesc
TUint aFlags
TRequestStatus & aStatus

Recv(RMBufChain &, TUint, TRequestStatus &)

IMPORT_C void Recv ( RMBufChain & aData,
TUint aFlags,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus

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

IMPORT_C void Recv ( TDes8 & aDesc,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

TDes8 & aDesc
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

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

IMPORT_C void Recv ( RMBufChain & aData,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

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

IMPORT_C void RecvFrom ( TDes8 & aDesc,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus
)

Parameters

TDes8 & aDesc
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

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

IMPORT_C void RecvFrom ( RMBufChain & aData,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

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

IMPORT_C void RecvFrom ( TDes8 & aDesc,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

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

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

IMPORT_C void RecvFrom ( RMBufChain & aData,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

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

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

IMPORT_C void RecvOneOrMore ( TDes8 & aDesc,
TUint aFlags,
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 void RemoteName ( TSockAddr & aAddr )

RSocket documentation

Parameters

TSockAddr & aAddr

Send(const TDesC8 &, TUint, TRequestStatus &)

IMPORT_C void Send ( const TDesC8 & aDesc,
TUint aFlags,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

const TDesC8 & aDesc
TUint aFlags
TRequestStatus & aStatus

Send(RMBufChain &, TUint, TRequestStatus &)

IMPORT_C void Send ( RMBufChain & aData,
TUint aFlags,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus

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

IMPORT_C void Send ( const TDesC8 & aDesc,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

RSocket documentation

Parameters

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

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

IMPORT_C void Send ( RMBufChain & aData,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

RSocket documentation

Parameters

RMBufChain & aData
TUint aFlags
TRequestStatus & aStatus
TSockXfrLength & aLen

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

IMPORT_C void SendTo ( const TDesC8 & aDesc,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus
)

Parameters

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

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

IMPORT_C void SendTo ( RMBufChain & aData,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus
)

Parameters

RMBufChain & aData
TSockAddr & aAddr
TUint aFlags
TRequestStatus & aStatus

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

IMPORT_C void SendTo ( const TDesC8 & aDesc,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

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

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

IMPORT_C void SendTo ( RMBufChain & aData,
TSockAddr & aAddr,
TUint aFlags,
TRequestStatus & aStatus,
TSockXfrLength & aLen
)

Parameters

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

SetImplementation(CInternalSocketImpl *)

void SetImplementation ( CInternalSocketImpl * aImplementation ) [private, inline]

Parameters

CInternalSocketImpl * aImplementation

SetLocalPort(TInt)

IMPORT_C TInt SetLocalPort ( TInt aPort )

RSocket documentation

Parameters

TInt aPort

SetOpt(TUint, TUint, const TDesC8 &)

IMPORT_C TInt SetOpt ( TUint aOptionName,
TUint aOptionLevel,
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 TInt SetOpt ( TUint aOptionName,
TUint aOptionLevel,
TInt aOption
)

RSocket documentation

Parameters

TUint aOptionName
TUint aOptionLevel
TInt aOption

Shutdown(RSocket::TShutdown, TRequestStatus &)

IMPORT_C void Shutdown ( RSocket::TShutdown aHow,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

RSocket::TShutdown aHow
TRequestStatus & aStatus

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

IMPORT_C void Shutdown ( RSocket::TShutdown aHow,
const TDesC8 & aDisconnectDataOut,
TDes8 & aDisconnectDataIn,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

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

Transfer(RInternalSocket &)

IMPORT_C TInt Transfer ( 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 void Write ( const TDesC8 & aDesc,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

const TDesC8 & aDesc
TRequestStatus & aStatus

Write(RMBufChain &, TRequestStatus &)

IMPORT_C void Write ( RMBufChain & aData,
TRequestStatus & aStatus
)

RSocket documentation

Parameters

RMBufChain & aData
TRequestStatus & aStatus

Member Data Documentation

CInternalSocketImpl * iImplementation

CInternalSocketImpl * iImplementation [private]