OSI/AS Programming Manual

Releasing a Connection
APS Procedures Programming Concepts
2–52 056783 Tandem Computers Incorporated
The following steps explain the release response sequence given in Table 2-20:
1. In the course of normal processing, you call APS_EVENT_RECEIVE_ to be
notified when you have received an event.
2. If the connection is in nowait mode, call MFM_AWAITIOX_ to wait for the
completion of the procedure and to obtain the status code.
3. When you have received an event, call APS_STATUS_ to find out which event it is.
If the event code is ZAPS-VAL-EVT-RELEASE-IND, you have received a release
indication.
4. For an ACSE connection, call APS_ASSOC_GETPARAM_ to get the release reason.
5. To obtain any user data from the release indication, call
APS_DATA_GETPARAM_.
6. To respond to the release and optionally send user data to the remote application,
call APS_ASSOC_RELEASERSP_. Note that you can refuse the release only if the
negotiated release functional unit is in use.
7. If the connection is in nowait mode, call MFM_AWAITIOX_ to wait for the
completion of the procedure and to obtain the status code.
8. If you agree to the release, call APS_DISCARD_ to discard the context information
for the connection and release the CEPI.
9. Finally, if you are using a static subdevice and do not want to reuse it, call the
APS_SUBDEVICE_DISCARD_ procedure.
Aborting a Connection To abruptly terminate a connection, call the APS_ASSOC_ABORTREQ_ procedure.
Note that data may be lost when you do this. Table 2-21 gives the sequence of
procedure calls needed to perform a user abort. The MFM_AWAITIOX_ call must be
included for a nowait connection, and must not be included for a waited connection.
The sequence of procedures is explained after the table.
Table 2-21. Sequence of Procedures for User Abort
Procedure What You’re Asking OSI/AS
APS_ASSOC_ABORTREQ_ Abort the connection; inform remote user.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
APS_DISCARD_ Discard the connection context.
[ APS_SUBDEVICE_DISCARD_ ] (For static subdevices only) Delete the subdevice.
The following steps explain the user abort sequence given in Table 2-21. The phrase
“user abort” denotes an abort initiated by a user rather than by the service provider.
For information about aborts initiated by the service provider, see “Provider Abort,”
later in this section.