Chapter 3 Of Names and Address Families

At this point, you know enough to build working TCP clients and servers. However, our examples so far, though useful enough, nevertheless have a couple of features that could be improved. First, the only way to specify a destination is with an IP address, such as 169.1.1.1 or FE80:1034::2A97:1001:1. This is a bit painful for most humans, who are—let’s face it—not that good at dealing with long strings of numbers that have to be formatted just right. That’s why most applications allow the use of names like www.mkp.com and server.example.com to specify destinations, in addition to Internet addresses. But the Sockets API, as we’ve seen, only takes numerical arguments, so applications need a way to convert ...

Get TCP/IP Sockets in C, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.