OSI/AS Programming Manual

Releasing a Connection
APS Procedures Programming Concepts
2–50 056783 Tandem Computers Incorporated
and one for the give tokens or please tokens primitive, just as if they had arrived
separately.
Releasing a
Connection
A connection can be terminated by your own application, by the remote application, or
by the service provider. It is also terminated if your application terminates abnormally
(abends). There are two types of connection release:
Orderly disconnections, during which all data is delivered before termination of
the connection
Abrupt disconnections (aborts and discards), during which undelivered data may
be lost
The following subsections describe the sequence of procedure calls for each type of
connection release.
Requesting an Orderly
Release
When your communication over a connection is finished, you should release the
connection. The procedure that requests the release is APS_ASSOC_RELEASEREQ_.
To call this procedure, you must hold all available tokens.
If you do not hold all the available tokens, you have two choices: you can wait for the
remote application to release the connection, or you can ask for the tokens. Table 2-8,
which appears earlier in this section, lists the sequence of calls you must make to
obtain the tokens. In
tokens
, specify all of the available tokens.
Table 2-19 gives the sequence of procedure calls needed for the orderly release of a
connection when you hold all of the available tokens. The procedure calls in square
brackets can sometimes be omitted, depending on the context. The sequence of
procedures is explained after the table.
Table 2-19. Sequence of Procedures for Release Request
Procedure What You’re Asking OSI/AS
APS_ASSOC_RELEASEREQ_ Release the connection.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
APS_EVENT_RECEIVE_ Give me the next event.
[ MFM_AWAITIOX_ ] (Nowait) Await completion; check status.
APS_STATUS_ Is the event a release confirm?
APS_ASSOC_GETPARAM_ Has the release been accepted?
[ APS_DATA_GETPARAM_ ] (Optional) Give me the confirm data.
[ APS_DISCARD_ ] (Accepting) Discard the connection context.
[ APS_SUBDEVICE_DISCARD_ ] (For static subdevices only) Delete the subdevice.
The following steps explain the release sequence given in Table 2-19:
1. When communication is finished, call APS_ASSOC_RELEASEREQ_.
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.