This chapter is challenging, exciting, and, ocassionally,
maddening. In addition to the difficulty of the individual
pieces, you have the challenge of putting them together.
You should think in terms of the ultimate goal which is
data transfer so you need three programs:
- A gateway program.
- A server program.
- A client program.
Unfortunately, to start testing you need all three in some
stage of development so you do well, as Professor Comer
suggests, to break the project down into small chunks.
Now your programs will undoubtedly work correctly right away,
but mine did not which brings us to the challenge of
debugging. There is a blessing in disguise associated with
a program that does not work out of the box, because there
is a great deal to be learned from the debugger. In this case
debugging itself is complicated by the need for three programs
to coordinate. What I ended up doing was getting a
window for each program, and then
running one and debugging two the choice determined by the
particular problem. Needless to say, I often made the wrong
choice.
For the first three experiments you need to set your timeout
value very high lest the act of debugging itself change your
results, ie, your server keeps resending because you haven't
gotten around to hitting the n key in your
client window. Once you get to experiment 8.4, you
face some real difficulties in debugging.
The experiment has you thinking in microseconds so
you will want to use the ualarm
function, but when debugging you might want to
use alarm
which takes its arguments in
seconds.
This site is maintained by W. David Laverell
of the Computer Science Department
at Calvin College. For assistance or corrections,
please contact him at .