5 the csappc source file 497 498 499 500 501 502 503

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: e context of the child, it has access to 662 CHAPTER 12. NETWORK PROGRAMMING the same open descriptors and environment variables that existed before the call to the execve function. Thus, everything that the CGI program writes to standard output goes directly to the client process, without any intervention from the parent process. Meanwhile, the parent blocks in a call to wait, waiting to reap the child when it terminates (line 17). Practice Problem 12.8: A. Is the T INY doit routine reentrant? Why or why not? B. If not, how would you make it reentrant? 12.9 Summary In this chapter we have learned some basic concepts about network applications. Network applications use the client-server model, where servers perform services on behalf of their clients. The Internet provides network applications with two key mechanisms: (1) A unique name for each Internet host, and (2) a mechanism for establishing a connection to a server running on any of those hosts. Clients and servers establish connections by using the sockets interface, and they communicate over these connections using standard Unix file I/O functions. There are two basic design options for servers. An iterative server handles one request at a time. A concurrent server can handle multiple requests concurrently. We investigated two designs fo...
View Full Document

Ask a homework question - tutors are online