Sinfamily afinet bcopychar hp haddr char

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ure 12.12: HOSTINFO : Retrieves and prints a DNS host entry. 618 official hostname: aol.com alias: www.aol.com address: 205.188.160.121 address: 64.12.149.13 address: 205.188.146.23 CHAPTER 12. NETWORK PROGRAMMING Finally, we notice that some valid domain names are not mapped to any IP address: unix> ./hostinfo edu Gethostbyname error: No address associated with name unix> ./hostinfo cmcl.cs.cmu.edu Gethostbyname error: No address associated with name Practice Problem 12.4: Compile the HOSTINFO program from Figure 12.12. Then run hostinfo aol.com three times in a row on your system. A. What do you notice about the ordering of the IP addresses in the three host entries? B. How might this ordering be useful? 12.3.3 Internet Connections Internet clients and servers communicate by sending and receiving streams of bytes over connections. A connection is point-to-point in the sense that it connects a pair of processes. It is full-duplex in the sense that data can flow in both directions at the same time. And it is reliable in the sense that — barring some catastrophic failure such as a cable cu...
View Full Document

Ask a homework question - tutors are online