The purpose of this lab is to allow students to become comfortable with Socket programming.
If you are not in our course email list, please subscribe to
the
cspp51081 email list here:
http://mailman.cs.uchicago.edu/mailman/listinfo/cspp51081
You will also find the course FAQ
containing useful information for this
assignment.
Lecture 8 is the primary source for information on programming Sockets. You can find additional information in the manpages, online, as well as the following sources:
TOTAL | 12 points |
Sockets enable processes connected over networks to communicate with one another. The socket interface allows for a standard set of function calls that hide some of the details of the underlying networking details from the programmer. We probably use sockets every day, you've used one to look at this web page (http connections are typically made as a socket connection to port 80 on a server). They are used for simple tasks such as public chat rooms and for complex tasks such as massively parallel super computer intercommunications. Here is a nice socket tutorial with code examples.
One common use of sockets is to facilitate a distributed workload system such that a slow client machine can make a computationally intensive request of a faster server machine via the network and sockets (in fact, this forms the basis of RPC concepts). The goal of this project is to write both a client and a server that together create such a system. The program flow could resemble the following:
The server must take the port number that it will be
listening to
as a command
line argument. The client must take the name of the server machine and
the
port number to connect to as two command line arguments. On the server
side,
you may use the file /usr/share/dict/words
on
CS machines to
look up the correct
spelling of user input. This means that a word not found on the list
will be considered to be
incorrectly spelled.
Additionally, your server will send a short list (no more than ten, but possibly none) of alternative spellings, if the word provided by the client does not appear in the list of words you searched. The new protocol will be
One heuristic for choosing alternative spellings (suggested in class), is to look for all words contain exactly the same consonants, in the same order, but considers vowel alternatives. A simple way to do this is to form a regular expression from a word, replacing each vowel with '[aeiou]?'. You may consider more elaborate alternatives. It is possible that there are no alternative spellings found. This should not happen too often though. Your heuristic should be able to provide the correct spelling for words like "booot" and "recieve".
Carefully follow the 5 steps below.
ex
: If you
are submitting the
exercise Makefile
, which
will build both
your client and server, when make
is entered
on the
command line. In addition, your make file must contain a target clean
which will remove all executables created by make
when make
clean
is entered on the command line.README
text file which
explains what your
server does for a client. You must also include an explanation of what heuristic you used to
provide alternative spellings. To | Nicholas Flees (nickflees@uchicago.edu) |
Attachment | username.lab8.tgz |
Subject | CSPP51081-lab8 |