Alert! A problem has emerged with the experiments in this
chapter! Many thanks to Professor Cozart of Mercer University
for bringing it to my attention.
It is a UNIX problem only (so far)!
If you are using a 64-bit computer with an up to date
compiler, echoserver will always terminate.
I have let Professor Comer know about this, but for the
time being here is a quick fix.
In the directory h there is a file named cnaipi.h.
On line 26 of this file there is a line that says typedef
long computer. Just change long to int,
and and the echo and chat software will work fine.
You might want to change long to int on line
43 of cname_to_comp.c in the api directory to avoid
some warnings. Many thanks to Dr. Cozart!
As is quite appropriate, the first programming experiments
in the book call for modifications to programs
available from Purdue University.
The directions for obtaining the software are
found under Obtaining Software For The API.
Your instructor may obtain the programs
and make them available to you.
Experiment 5.1 requires you to compile
and test an echo client. It is possible that
the procedure will not be completely transparent
to some students (it takes a few minutes thought
to see how things are organized), but detailed
directions are to be found on the page for this
experiment. The Optional Extensions are interesting
and are not difficult. I would encourage you
to perform further experiments such as the one
described on the page.
"Odd" behavior is interesting, and you can learn a lot by
persuing explanations.
Experiment 5.2 requires adding some features.
This requires familiarity with the basic string
handling functions in C
. The first
Optional Extension is of great interest. The comment
that "Sending the remote user's name with each line
of text wastes network bandwidth" is of special interest.
Why worry about 6 bytes? It is the principle!
Watch out for the second Optional Extension. It
is, in my opinion, extremely difficult. See the page
for this experiment for details. As best as I can tell
at the moment (I plan to come back to this one once I
am further along), changing the terminal settings require
modification to the library code provided. Nasty, but
challenging.
Experiment 5.3 introduces the student to file transfer.
This idea will appear again in Experiment 6.3, and then
again in Expriments 8.3 and 8.4.
This site is maintained by W. David Laverell
of the Computer Science Department
at Calvin College. For assistance or corrections,
please contact him at .