CProtocolFamilyBase Class Reference

class CProtocolFamilyBase : public CBase

Defines the interface for protocol families.

Protocol families must:

be able to identify the protocols which they can create

be able to create instances of protocol objects for all the protocols they advertise

Inherits from

Constructor & Destructor Documentation

CProtocolFamilyBase()

IMPORT_CCProtocolFamilyBase()

Constructor for the protocol family

~CProtocolFamilyBase()

IMPORT_C~CProtocolFamilyBase()[virtual]

Destructor for the protocol family Calling this means that all protocols have been unloaded and we can close the library after our death.

Member Functions Documentation

Close()

IMPORT_C voidClose()[virtual]

replacment close gives any derived class chance to delete anything it wants or to signal an error.

Closes this reference counting object

Install()

TInt Install()[pure virtual]

Initialises a protocol family.

After the CProtocolFamilyBase-derived object has been created, the first function called by the socket server on that object is Install(). It is at this point that the CProtocolFamilyBase-derived object should perform any initialisation which it needs.

NewProtocolL(TUint, TUint)

CProtocolBase *NewProtocolL(TUintaSockType,
TUintaProtocol
)[pure virtual]

Creates a new protocol object.

During socket creation, after the socket server has called Open() on a protocol family, it next calls this function to create an instance of a CProtocolBase-derived object - the protocol itself.

Parameters

TUint aSockTypeA supported socket type for the protocol family as advertised in the protocol list.
TUint aProtocolA protocol number specifying a protocol returned by ProtocolList().

Open()

IMPORT_C voidOpen()[virtual]

Opens a protocol family.

When a socket is created, the socket server first calls this function on the protocol family. It is not compulsory for the protocol family to implement this function - the default behaviour of the socket server, which is to increment an access count for the protocol family, may be sufficient.

ProtocolList(TServerProtocolDesc *&)

TUint ProtocolList(TServerProtocolDesc *&aProtocolList)[pure virtual]

Gets a list of supported protocols.

Called during initialisation, directly after Install(). ProtocolList() returns a list of all the protocols in the protocol family. The protocol family object should allocate memory to hold an array of TServerProtocolDesc structures. This function should then fill them in and return the pointer and a count of the number of protocols supported. The socket server caches this information, so that it does not need to keep the protocol module loaded.

The protocol family should not attempt to use static data (which it can't) or to free this memory later, as the socket server will automatically free this storage.

Parameters

TServerProtocolDesc *& aProtocolListThis pointer is set to point to memory allocated by the protocol family and filled in as described above

QueryVersionSupported(const TVersion &)

IMPORT_C TBoolQueryVersionSupported(const TVersion &aVer)const [virtual]

Queries whether the version is supported by the protocol

Parameters

const TVersion & aVer

RefCount()

TInt RefCount()const [inline]

Remove()

IMPORT_C TIntRemove()[virtual]

Prepares the protocol family to be removed in a derived class.

The socket server calls Remove() before unloading the library for a given protocol family.

Note:

This implementation returns KErrNone.

SetLibraryL(RLibrary &)

voidSetLibraryL(RLibrary &aLib)

Sets the Protocol Family's resource library to dynamically loadable DLL.

Parameters

RLibrary & aLib

Member Data Documentation

CLibUnloader * iLibUnloader

CLibUnloader *iLibUnloader[private]

CProtocolFamilyRef * iManagerRef

CProtocolFamilyRef *iManagerRef[private]

TInt iRefCount

TInt iRefCount[private]

TVersion iVersion

TVersion iVersion[protected]

Contains version information