Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 20 Acknowledgements: The syllabus and power point presentations are modified versions of those by T. Baker and X. Yuan
Announcements Reading assignment Chapters 5 Chapter 6 Section 6.3 and 6.8 You may need to refer to other sections occasionally, especially sections 6.4 and 6.7
Week 8 Topics Client-Server design Client-server design alternatives Concurrent server Programming assignment 3 discussion Client-server design alternatives Server with multiplexed I/O Preforked server
Client-Server design Concurrent server
Concurrent server See example2[abc].c Use a new child process to handle a new connection request Advantages Simple program Large number of connections Main limitation: too much overhead
Server crashing What happens to the client when the server crashes? How can we make the client anticipate the problem? example1a.c The client has two places that can block – it may not be able to detect that something is wrong Solution I/O multiplexing – check the file descriptor before performing a blocking operation Mechanism: select