
MAILSLOTS
335
•Extension to networked cli ents is straightforward, subject to the limitations of
named pipes discussed earlier in this chapter. Simply change the pipe names in
the header file, or add a client command line parameter for the server name.
•Each server worker thread creates a simple connect
ion thread, which calls
and terminates as soon as a client connects. This allows a
worker thread to wait, with a time-out, on the connection thread handle and
test the global shutdown flag periodically. If the worker threads blocked on
, they could not test the flag and the server could not shut
down. For this reason, the server thread performs a
on ...