FTAM/9000 Programmer's Guide

178 Chapter 4
Using Support Functions
Responding to Asynchronous Calls
The following text describes the sequence of making asynchronous
requests and checking for their successful return from the responder.
1. Submit one or more asynchronous requests, each with a unique
return_event_name.
2. Call em_wait() to determine if the requests returned successfully
from the responder; you cannot specify the return_event_name for
which you want to wait.
Though em_wait() function waits on multiple asynchronous calls, it
returns return_event_names one at a time and in the order that each
call completes.
3. Check the inout_dcb of the FTAM function (specified by the
return_event_name) to determine the result of a completed request.
Note, the inout_dcb pointer and structure are not valid until the
em_wait() request returns successfully.
Since events can return in any order, the return_event_name
returned may or may not be the first operation you requested or the
one on which you are waiting.
A return_event_name returns only once. Therefore, you should
process the inout_dcb for all return_event_names in the order in
which they return or track all the return_event_names that return
(for future use).
4. Continue calling em_wait() until you receive the return_event_name
you want. If applicable, call em_wait() until all requests are
processed.
NOTE Do not perform any operations on or with an inout_dcb pointer or
structure until em_wait() indicates the call using the inout_dcb is
complete.