CS 3733 Operating Systems, Fall 2008 Recitation Session 10
Friday, November 14 at 2 PM
In this session you will become familiar with using UICI.
- Create a Rec10 directory.
- Download the
tar
file of the programs from Chapter 18 and untar them in your Rec10
directory.
- Execute the convertlinux script.
This modifies the makefile to include -D_GNU_SOURCE
and remove the reference to -lsocket during compilation.
- Use make to compile all of the programs.
- 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.
Find the list of assigned port numbers here.
The list contains the starting port number assigned to each student.
- Open two terminal windows.
Get into the Rec10 directory in each.
- Choose one of your assigned port numbers and run the serverp
program using that port number.
- In the other window, run the client program, connecting to
your server program.
- 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.
- 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.
- 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 Rec10 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:
- Does the second client2 report making a connection?
- Can the second client communicate with the server?
- What happens when you terminate the first client?
- What happens of a client tries to connect to a server that is not
there, say by entering the wrong port number?
- 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.
- Test serverp2 with client2 as in step 10.
- Now find two or more other people in the lab to communicate with.
- One person will run serverp2 and the others with run their
client2 programs, connecting to the single serverp2
server.
- Each of the clients will need to know the port number and host name
used by the serverp2 program.
- Try to type back and forth.
- The server should receive everything from all of the clients.
- What happens to the text that is typed at the server?
How many clients get it?
Does it always go to the same place?
- After you do this for a while, switch off and let others run
the server.
- Make sure the TA has seen that you have done this.