OSI/AS Programming Manual

Establishing a Connection
APS Procedures Programming Concepts
056783 Tandem Computers Incorporated 2–31
Table 2-13. Sequence of Procedures to Establish a Connection as the Responding User
Procedure What You’re Asking OSI/AS
[ APS_INITIALIZE_ ] (Once only) Initialize the API.
APS_ASSOC_ATTACH_ Prepare to accept a connection.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
[ APS_ASSOC_GETPARAM_ ] (Optional) What is my OSI address?
APS_EVENT_RECEIVE_ Give me the next event.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
APS_STATUS_ Is the event a connect indication?
APS_ASSOC_GETPARAM_ Who wants to connect, and how?
[ APS_DATA_GETPARAM_ ] (Optional) Give me the indication data.
APS_ASSOC_CONNECTRSP_ Accept the connection.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
The following steps explain the sequence of procedure calls given in Table 2-13:
1. If you have not already called APS_INITIALIZE_ , you must do so (see
“Initializing the API,” earlier in this section).
2. To show that you are willing to receive a connection from a remote system, call
APS_ASSOC_ATTACH_ ; use
service-id
to specify whether you are expecting
a session, presentation, or ACSE connection. The information you must give is
described under APS_ASSOC_ATTACH_ in Section 3. The procedure returns a
CEPI and, if successful, the status ZAPS-VAL-STATUS-OK.
If the procedure fails, it returns a status code other than ZAPS-VAL-STATUS-OK
and a CEPI of -1. To obtain details of an error at this stage, call APS_STATUS_
with the returned CEPI.
3. If the connection is in nowait mode, call MFM_AWAITIOX_ to wait for the
completion of the procedure. MFM_AWAITIOX_ gives you the status code for the
completed procedure call. If the status is not ZAPS-VAL-STATUS-OK, call
APS_STATUS_ , specifying the CEPI you received in step 2.
4. Optionally, call APS_ASSOC_GETPARAM_ to obtain the OSI address of your
application (if you specified only the application name in the call to
APS_ASSOC_ATTACH_).
5. Next, to be able to receive a connect indication event, call
APS_EVENT_RECEIVE_. In wait mode, this procedure returns a status code of
ZAPS-VAL-STATUS-EVENT when an event has been received.
6. If the connection is in nowait mode, call MFM_AWAITIOX_ to wait for
completion of the procedure and to obtain the status code. As above, a status code
of ZAPS-VAL-STATUS-EVENT means you have received an event.