Internetworking With TCP/IP Volume 3 (Windows Sockets version)
Pages 28-31, consum.cpp
The printed version of the code for program consum.cpp contains a
typo in the declaration of the first argument in the call to _beginthread
(note that the code available for FTP is correct).
The incorrect line, which appears three times on pages 28 through 31, should
read:
Unlike Berkeley Unix, the Windows Sockets implementation of FD_SET
does not maintain a true set. Thus, multiple calls to set a given descriptor
will add multiple entries. Move the call to FD_ZERO() into the beginning
of the while loop before the calls to FD_SET().
Page 381, fsminit.cpp
Incorrect initialization of ``invalid'' states of the finite state.
Although there is no way to reach these states, the intention was to
initialize the entries to abort. Change the loop to use a new index,
ti2 as in the following:
/* set all uninitialized indices to an invalid transition */
for (cn=0; cn<NCHRS; ++cn)
for (ti2=0; ti2<nstates; ++ti2)
if (fsm[ti2][cn] == TINVALID)
fsm[ti2][cn] = ti;