Instruction manual

SECTION 8. FILES, PROTOCOLS, AND UTILITIES
8-5
FIGURE 8.5-2. Server State Diagram
Key concepts from the state diagrams are
shown in the following tables with key words
(bold) from the diagrams.
CLIENT STATE DIAGRAM:
Test For Server Rdy With Named Pipe and
Socket API's, there will usually exist a function
used to open the pipe or socket. In this state,
the client program should attempt to open the
pipe or socket. If Open Failed, the client
should wait a while (5 seconds) and try again.
Wait For Record In this state the client is waiting
for the next data record from the server. When a
record is received it should be "secured" (saved to
disk or data base), then an acknowledgment
should be sent back to the server. Once the
server has processed the acknowledgment it will
not send that record again. The client should use
a watchdog timer while waiting for a data record. If
the client is in the Wait For Record state for
longer than expected (RecIntv2) then it should
assume that the server has died and close the
session. This watchdog operation may be difficult
to implement, but it seems that some implementa-
tions of pipes and sockets do not properly report a
broken pipe or socket, so the watchdog is
necessary for reliability.
Rec Intv 2 This is an amount of time greater
than 2 times the expected interval between data
records. It is just longer than the longest period
between records the client would expect to receive
from the server. If the client goes longer than this
interval without receiving a new record then it
should close and reopen the pipe or socket thus
allowing the server to recover if it has broken
Secure Rec The secure record action is
taken when a Record Rdy event occurs while
the client is in the Wait For Record state.
Before the client sends an acknowledgment to
the server it should secure the data record well
enough so that if a power failure or crash
occurs the data will be safe.