44
CPhoneFactoryBase
class is used as a basis for the telephony devices themselves, after
which classes derived from
CPhoneBase
,
CLineBase
and
CCallBase
are used to
control phones, lines and calls respectively. Because of the real-time constraints of the ITU fax
protocols, the
CFaxBase
derived class in the fax server, which provides the necessary fax
functionality, has additional responsibility for the progress of the ITU-T.30 fax negotiations and
the transfer of ITU-T.4 fax data.
8.4.4. Sockets and TCP/IP
EPOC networking communications is provided by the socket server, ESOCK, together with the
network interface manager, NIFMAN.
8.4.4.1 Sockets
ESOCK’s client API is defined in
es_sock.h
. The main classes are
RSocketServ
, a session
to the server, and
RSocket
, a communications socket. The sockets API is modelled on the BSD
sockets API and provides a protocol independent interface to networking functions.
TSockAddr
defines a 32-byte socket address whose format depends on the socket protocol in
use.
RHostResolver
,
RServiceResolver
and
RNetDatabase
provide asynchronous
lookup facilities for host names, services and general queries on network databases.
EPOC’s native sockets API, like all its APIs, is object oriented. Programs written in EPOC C++,
using this API, can be very efficient. Legacy programs written in pure C are also supported
through the EPOC C Standard Library, which provides POSIX-like system, calls. These are
layered over EPOC’s object-oriented sockets and file server APIs to provide an implementation of
the BSD C API, including unification of file and sockets services. Although this only supports
single sockets, it does allow existing engine code to be ported to EPOC with relative ease.
Implementation of ESOCK and NIFMAN APIs
8.4.4.2 Protocols
ESOCK’s provider API is defined in
es_prot.h
. It consists of classes providing server-side
functions for the client API.
A sockets protocol is implemented using a polymorphic DLL whose extension is conventionally
.prt
and whose second UID is 0x1000004A.