2009-11-17

Chapter 59: Sockets: Internet Domains

Having looked at generic sockets concepts and the TCP/IP protocol suite in previous chapters, we are now ready in this chapter to look at programming with sockets in the IPv4 (AF_INET) and IPv6 (AF_INET6) domains.

As noted in Chapter 58, Internet domain socket addresses consist of an IP address and a port number. Although computers use binary representations of IP addresses and port numbers, humans are much better at dealing with names than with numbers. Therefore, we describe the techniques used to identify host computers and ports using names. We also examine the use of library functions to obtain the IP address(es) for a particular hostname and the port number that corresponds to a particular service name. Our discussion of hostnames includes a description of the Domain Name System (DNS), which implements a distributed database that maps hostnames to IP addresses and vice versa.

59 Sockets: Internet Domains
59.1 Internet Domain Sockets
59.2 Network Byte Order
59.3 Data Representation
59.4 Internet Socket Addresses
59.5 Overview of Host and Service Conversion Functions
59.6 IPv6 and IPv4 Address Conversion: inet_pton() and inet_ntop()
59.7 Client-server Example (Datagram Sockets)
59.8 Domain Name System (DNS)
59.9 The /etc/services File
59.10 Protocol-independent Host and Service Conversion
        59.10.1 The getaddrinfo() Function
        59.10.2 Freeing addrinfo Lists: freeaddrinfo()
        59.10.3 Diagnosing Errors: gai_strerror()
        59.10.4 The getnameinfo() Function
59.11 Client-server Example (Stream Sockets)
59.12 An Internet Domain Sockets Library
59.13 Obsolete APIs for Host, Service, and Address Conversion
        59.13.1 The inet_aton() and inet_ntoa() Functions
        59.13.2 The gethostbyname() and gethostbyaddr() Functions
        59.13.3 The getservbyname() and getservbyport() Functions
59.14 UNIX Versus Internet Domain Sockets
59.15 Further Information
59.16 Summary
59.17 Exercises

No comments:

Post a Comment