OSI/AS Programming Manual
Releasing a Connection
APS Procedures Programming Concepts
056783 Tandem Computers Incorporated 2–53
1. If you decide to abort the connection, call APS_ASSOC_ABORTREQ_. This
procedure lets you send user data with the request so that you can, for example,
give the reason for the abort.
2. If the connection is in nowait mode and you are interested in receiving any
outstanding events, call MFM_AWAITIOX_ to wait for the completion of the
procedure and to obtain the status code.
3. Call APS_DISCARD_ to discard the context information for the connection and
release the CEPI.
4. Finally, if you are using a static subdevice and do not want to reuse it, call the
APS_SUBDEVICE_DISCARD_ procedure.
Discarding the Context for
a Connection
The most abrupt way to terminate a connection is to call APS_DISCARD_ without
previously calling APS_ASSOC_RELEASEREQ_ or APS_ASSOC_ABORTREQ_. You
can call APS_DISCARD_ at any time; note, however, that as with an abort, data may
be lost.
Unlike APS_ASSOC_ABORTREQ_ , APS_DISCARD_ does not invoke a primitive to
the remote application. For this reason, it is almost always preferable to abort (or
release) a connection before discarding the context. However, if the connection is lost
and you receive a ZAPS-VAL-STATUS-DISCARD status value, you should simply call
APS_DISCARD_.
Provider Abort The service provider aborts a connection if it can no longer provide the service. Note
that for ACSE connections, as for session and presentation connections, OSI/AS sends
an abort indication to both the local and the remote application.
Table 2-22 shows how you are informed of a provider abort and gives the sequence of
procedures you should call when a provider abort occurs. 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-22. Sequence of Procedures to Handle a Provider Abort
Procedure What You’re Asking OSI/AS
APS_EVENT_RECEIVE_ Give me the next event.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
APS_STATUS_ Which event have I received?
APS_ASSOC_GETPARAM_ Why has the provider aborted the connection?
APS_DISCARD_ Discard the connection context.
[ APS_SUBDEVICE_DISCARD_ ] (For static subdevices only) Delete the subdevice.
The following steps explain the provider abort sequence given in Table 2-22:
1. In the course of normal processing, you call APS_EVENT_RECEIVE_ to be
notified when you have received an event.