OSI/FTAM Programming Guide

Using FTM Procedure Calls
HP NonStop OSI/FTAM Programming Guide528612-001
4-4
Initializing the API
contains programming examples in TAL and C that demonstrate reading and
writing FTAM files.
Initializing the API
When your application is running, but before it establishes its first FTAM association
across the network, it must call the APS_INITIALIZE_ procedure. This procedure
allocates an extended segment that the FTAM API can use to maintain the context
information for all the FTAM associations your application establishes. The API
segment exists as long as your application process exists. Call the APS_INITIALIZE_
procedure only once for each instance of your application process.
For details on the APS_INITIALIZE_ procedure, see the OSI/FTAM Programming
Reference Manual.
Receiving an Event
When your application receives an indication or confirm primitive, it is receiving an
event. To retrieve event information using an FTM indication or confirm procedure, you
must first call APS_EVENT_RECEIVE_, specifying as input the CEPI returned by the
FTM_INITIALIZE_REQ_ procedure for the association. The event data comes across
the network into a local FTAM API segment in memory. To identify the event received,
call APS_STATUS_. For reference information about these APS procedure calls, see
the OSI/FTAM Programming Reference Manual.
If an event is received, call the appropriate indication or confirm procedure; for
instance, call the confirm procedure corresponding to the request that you made. The
event information maps into the procedure parameters. This information is then
available to your application.
You might not always receive the event you expect because of error or abort
conditions, or cancel requests from the remote responder. You can receive an
F-U-ABORT or F-P-ABORT indication at any time. Also, several primitives are issued
to complete FTAM read and write tasks; when reading a file, for example, you can
receive F-DATA, F-DATA-END, or F-CANCEL indication primitives. For details about
valid sequences of primitives, refer to ISO-8571.
The sequence of procedures to call to receive an event in an FTAM application is
shown in Table 4-2 on page 4-5.