1. List in order the system calls a client would make in order to create a socket connection with a server. For each function, tell its purpose, the arguments it takes, the value it returns (if any), and what system calls (if any) the server would need to have made in order for the client's call to succeed.
  2. Assuming a client and server have established a socket connection, they can exchange messages using read() and write() system calls. Assume either the client or server executes "bytesRead = read(fd, buffer, 512);" and tell what conditions (if any) might cause bytesRead to take on the values -1, 0, 321, 512, and 1024. In addition, tell what might cause the read() function never to return at all.
  3. Tell the difference between an iterative and a concurrent server. Tell the types of application where each would be appropriate, and outline algorithms that could be used to implement a server of each type.
  4. For both the X Window System and the ftp protocol, compare and contrast the roles of client and server programs. Be sure your answer includes the following two pieces of information:
  5. What is the role of the following functions in a toolkit-based application?
  6. Describe the arguments that are passed to a callback function. What does a callback function do when it finishes processing a callback event? How can you debug a callback function using gdb or ddd?

Christopher Vickery
Queens College of CUNY
Home Page