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 188.8.131.52:51213 server socket address 184.108.40.206:80 619 client connection socket pair (220.127.116.11 :51213, 18.104.22.168:80) server (port 80) server host address 22.214.171.124 client host address 126.96.36.199 Figure 12.13: Anatomy of an Internet connection
188.8.131.52:51213 where port 51213 is an ephemeral port assigned by the kernel. The Web server’s socket address is
184.108.40.206: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
(220.127.116.11:51213, 118.104.22.168: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