The Sockets Client API (sometimes called after its library name ESOCK) provides a generic interface to communications protocols through communication end points known as sockets. The sockets are similar in concept to Berkeley Software Distribution (BSD) sockets from the University of California at Berkeley. They provide a generic interface to network level communications protocols for common operations involved in network computing. These include sending data, receiving data, establishing connections, and configuring network protocols. In addition to sockets, the Sockets Client API provides access points to other network facilities such as hostname resolution, service resolution, protocol information, and various byte manipulation utilities.
The Sockets Client interfaces make asynchronous calls to a sockets server, which co-ordinates client access to socket services, and manages communications with the protocol modules that provide support for the particular networking protocols.
Each protocol module may contain several protocols. The term ‘protocol’ may also be used to describe a suite of protocols: for instance the tcpip.prt
protocol module contains UDP, TCP, ICMP, IP, and DNS, of which UDP and TCP are accessible via sockets to transfer data over IP. Aside from TCP/IP, the other commonly used protocol module is IrDA, for communicating over infrared.
Protocols are loaded by the sockets server at runtime either explicitly or on demand. When the server is started, it scans \system\data\
for .esk
files to see which protocols and services are defined, and which protocol modules to load.
The Sockets Client API implements the idea of transport independence: different protocols are accessed through the same API. However, individual protocols exhibit different properties and semantics regarding socket behaviour. The semantics implemented by any given protocol can be found by interrogating the system using RSocketServ::GetProtocolInfo()
, which will describe the protocol semantics encapsulated in a TProtocolDesc
.