Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to write CProtocolFamilyBase::Open()

When a socket is created, the socket server first calls the Open() 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 just to increment an access count for the protocol family, may be sufficient. During socket creation, after the socket server has called Open() on a protocol family, it next calls NewProtocolL() to create an instance of a CProtocolBase-derived object — the protocol itself.

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

The default code in the socket server is:

EXPORT_C void CProtocolFamilyBase::Open()
    {
    iRefCount++;
    }