EE 607 Spring 2006 Project 1

Due Feb. 6 (mon), 10 points

For this assignment you will write (actually modify) C code for a client and server.

The server will serve files. It should be located in one of your UNIX accounts and in its own directory. In the directory, you should also have the following text files (these can be downloaded by clicking them):

  1. file1.txt
  2. file2.txt
  3. file3.txt

The client will get a file from the server and print it out on the terminal. If the file is not found then the client prints out a corresponding message. The following is an example of using a client, assuming its executable has been renamed "getfile". Shown in red are what was typed in, and shown in green are the responses from the computer.

getfile file1.txt

Aloha!

You have reached file 1.
This means that your client and server works at least partially.
Congratulations!!

Adios

getfile whoa

File "whoa" not found


Instruction

Hints:

gcc client.c -lnsl -lsocket -lresolv