This preview shows page 1. Sign up to view the full content.
Unformatted text preview: s, cliport is the client’s port, servaddr is the server’s IP address, and servport is the server’s port. For example, Figure 12.13 shows a connection between a Web client and a Web server. In this example, the Web client’s socket address is 12.4. UNIX FILE I/O
client socket address 220.127.116.11:51213 server socket address 18.104.22.168:80 619 client connection socket pair (22.214.171.124 :51213, 126.96.36.199:80) server (port 80) server host address 188.8.131.52 client host address 184.108.40.206 Figure 12.13: Anatomy of an Internet connection
220.127.116.11:51213 where port 51213 is an ephemeral port assigned by the kernel. The Web server’s socket address is
18.104.22.168:80 where port 80 is the well-known port associated with Web services. Given these client and server socket addresses, the connection between the client and server is uniquely identiﬁed by the socket pair
(22.214.171.124:51213, 1126.96.36.199:80). In Section 12.5 we will learn how C programs use the sockets interface to establish connections between clients and servers. But since sockets are modeled in Unix as ﬁles, we must...
View Full Document
- Spring '10
- The American