CS 3733 Operating Systems Recitation Session H


In this session you will become familiar with using UICI.

  1. Create a RecH directory.
  2. Download the tar file of the programs from Chapter 18 and untar them in your RecH directory.
    You can get a copy of this tar file by executing:
    wget /usp/programs/usp_ch18.tar
  3. Execute the convertlinux script.
    This modifies the makefile to include -D_GNU_SOURCE and remove the reference to -lsocket during compilation.
  4. Use make to compile all of the programs.
  5. You need to choose a port number for your network communication tests. Each student in the class has been assigned 10 consecutive port numbers that will not conflict with those used by other students in the class.
    The list contains the starting port number assigned to each student.
    There is a link to this list on the main course web page.
  6. Open two terminal windows.
    Get into the RecH directory in each.
  7. Choose one of your assigned port numbers and run the serverp program using that port number.
  8. In the other window, run the client program, connecting to your server program.
  9. You should be able to type in the second window and have the results appear in the first window.
    Notice that when you type at the client, the server does not get anything until you push the RETURN key.
    You should understand why this is the case.
  10. Terminate both programs and do the same thing with the server2 and client2 programs.
    These are bidirectional so you should be able to type in either windows and have the result appear in the other.
  11. The server2 program is a serial server.
    It will not accept a second connection until the first one has ended.
    Open a third window in the RecH directory and run a copy of client2 to try to connect to the same server2 program while the first client2 is still active.
    Make sure you know the answers to the following:
    1. Does the second client2 report making a connection?
    2. Can the second client communicate with the server?
    3. What happens when you terminate the first client?
    4. What happens if a client tries to connect to a server that is not there, say by entering the wrong port number?
  12. You should also have a copy of the program serverp2.c which is like serverp except that it calls copy2files instead of copyfile.
    This is a bidirectional parent server.
  13. Test serverp2 with client2 as in step 10.
  14. Now find two or more other people in the lab to communicate with.
  15. Make sure the TA has seen that you have done this.