OSI/AS Programming Manual

Establishing a Connection
APS Procedures Programming Concepts
2–32 056783 Tandem Computers Incorporated
7. If you have received an event, call APS_STATUS_ to find out which event it is. If
the event code is ZAPS-VAL-EVT-CONNECT-IND, you have received a connect
indication.
If you receive ZAPS-VAL-EVT-P-ABORT-IND (provider abort indication), the
connect indication has failed at some layer. If this happens, reissue the attach.
Note OSI/AS issues a provider abort indication when a session, presentation, or ACSE connect indication fails.
This action is consistent with the OSI Session Layer and Presentation Layer standards, but differs from
what might be expected from reading the ACSE protocol standard (ISO 8650).
8. When you receive a connect indication, call the APS_ASSOC_GETPARAM_
procedure to find out which application is trying to connect with you. This
procedure also returns the remote application’s session service requirements to
you. Your application can decide whether to accept these service requests or
negotiate for its own.
APS_ASSOC_GETPARAM_ also returns additional relevant information for
presentation and ACSE connections. For more details on the available
information, see the description of APS_ASSOC_GETPARAM_ in Section 3.
9. To retrieve the user data, if any, from the connect indication, call the
APS_DATA_GETPARAM_ procedure.
10. If everything is acceptable so far, call the APS_ASSOC_CONNECTRSP_ procedure
to give your response. Specify the CEPI you’re responding to, the address of your
application, and the connect result (your acceptance or rejection). If accepting,
base your session service requirements on those of the remote application, as
described in the considerations for this procedure in Section 3. Optionally, specify
your part of the connection identifier and send some user data.
For a presentation or ACSE connection, also specify the presentation context
definition result list and other relevant parameters, as described under
APS_ASSOC_CONNECTRSP_ in Section 3.
11. If the connection is in nowait mode, call MFM_AWAITIOX_ to wait for the
completion of the procedure and to obtain the status code.
If you have accepted the connection, you can now start to use it. You can, if activity
management is available and you hold the relevant tokens, start an activity using
APS_ACTIVITY_STARTREQ_. Or, you can send data over the connection, using
APS_DATA_REQ_.
If you have rejected the connection, clear the context information for the connection by
calling APS_DISCARD_. Then, if you wish to receive further connect indications, start
the sequence again by calling APS_ASSOC_ATTACH_.