OSF DCE Application Development Guide--Core Components

Time-Provider Interface
1. Initialize the TP process, as described previously. Listen for RPC calls.
2. If the ContactProvider procedure is invoked, perform the following steps:
a. Initialize the control message to the appropriate values (status value to
K_TPI_SUCCESS; nextPoll, timeout, and noClockSet to valid integer
values).
b. Set the communication status output parameter to rpc_s_ok.
c. Return from the procedure call. (The DCE RPC runtime returns the values
to DTS.)
3. If the ServerRequestProviderTime procedure is run, perform the following steps:
a. Initialize the timestamp count to the appropriate number.
b. Use the utc_gettime( ) DTS API routine to read the system time.
c. Poll the external time source and read a UTC value. Use the utc_gmtime( )
routine to convert the UTC time value to a binary timestamp.
d. Use the utc_gettime( ) routine to read the system time.
e. Repeat steps b, c, and d the number of times specified by the values of
K_MIN_TIMESTAMPS and K_MAX_TIMESTAMPS.
f. If steps b, c, or d return erroneous data, initialize the TP process status field
(TPstatus) of the data message to K_TPI_FAILURE; otherwise, initialize
the data message timestamps.
g. Set the communication status output parameter to rpc_s_ok.
h. Return from the procedure call. (The DCE RPC runtime sends the values
back to DTS.)
4. The TP process continues listening for RPC calls.
20.5 DTS Synchronization Algorithm
DTS performs the following steps to synchronize with an external time-provider:
1. At startup time, create the binding handle for the TPI. The binding handle is
obtained from the list of available protocol sequences on the system.
2. At synchronization time, make the remote procedure call ContactProvider,
assuming that a TP process is running on the system. If the procedure call fails,
examine the RPC communication status, checking the availability of the server. If
the server is unavailable, synchronize with peer servers; otherwise, continue.
3. Wait for the procedure call to return the control message in the output parameter.
If the procedure call does not return within the specified LAN timeout interval,
synchronize with peer servers. Otherwise, go to step 4.
4. If the procedure call returned successfully (communication status is rpc_s_ok),
read the data in the control message.
124245 Tandem Computers Incorporated 20 11