OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual—528611-001
G-3
Example 1—Updating a Remote File (in Nowait
Mode)
Example 1—Updating a Remote File (in Nowait Mode)
This programming example illustrates selective updating of an FTAM-2 file. It
implements the routines for writing a FADU to a file on a remote system. All the FTAM
routines operate in nowait mode. Nowait mode provides the benefits of improved
performance in that it allows the program to perform multiple I/O operations
concurrently. This also allows a faster response to remote indications. For more
information about nowait mode, see the OSI/FTAM Programming Guide.
To demonstrate the use of nowait mode, this program has at least two operations
outstanding after the initialize request has been issued: an event receive and a request
to the remote responder. During data transfer, a Guardian read is also outstanding.
This example does the following:
1. Opens the local Guardian file for reading.
2. Establishes an APS segment for the association.
3. Initializes the association.
4. Selects and opens the file on the remote responder.
5. Requests the transfer of the FADU data to the remote file.
6. Reads a Guardian file with a Guardian READ call.
7. Transfers the data.
8. Indicates the end of the transfer of FADU data.
9. Ends the transferring of data to the file.
10. Closes and deselects the file.
11. Terminates the association.
12. Discards the association.
13. Closes the local Guardian file.
Figure G-1 on page G-4 shows the protocol diagram detailing the sequence of APS
and FTM procedure calls used in Example 1. The numbers at the left of the diagram
correspond to the program tasks (1 through 13) described above. To distinguish
MFM_AWAITIOX_ procedures for network events and I/O completions, suffixes (EVT)
and (I/O) have been appended to the MFM_AWAITIOX_ procedure calls.