OSI/AS Programming Manual

Establishing a Connection
APS Procedures Programming Concepts
056783 Tandem Computers Incorporated 2–27
Initializing the API When your application is running, but before it can establish its first OSI/AS
connection, it must call the APS_INITIALIZE_ procedure. This procedure asks the
API to allocate and initialize a reserved extended segment for this instance of your
application—that is, for this particular Guardian 90 process. The API manages this
segment, using it to maintain the context information for all the OSI/AS connections
your application establishes. If your application uses its own extended segment, the
API handles any necessary switching between the segments.
The API segment remains in existence as long as this instance of your application
exists. Do not call APS_INITIALIZE_ more than once for each instance of your
application.
Establishing a
Connection
Connections between your application and a remote application in the OSI
environment can be initiated by either application. This subsection explains the
sequence of procedure calls for both requesting a connection and establishing a
connection requested by a remote application.
If you wish to request a connection, you call APS_ASSOC_CONNECTREQ_. When
you make this call, the API communicates with the OSI manager process and then
with the appropriate TAPS process. The TAPS process, in turn, requests services from
an underlying TSP process, and the TSP process requests services from an NSP
process. Information about the connection attempt is returned to you in two stages, as
follows:
1. OSI/AS completes the connect request. You receive the status of the completion
directly or, in nowait mode, through MFM_AWAITIOX_. The status ZAPS-VAL-
STATUS-OK means that all necessary OSI/AS subsystem processes are available
and that the Transport Layer has successfully connected and is in data transfer
mode.
2. If the connection attempt was successful, you receive a connect confirm primitive.
The value ZAPS-VAL-CON-ACCEPT returned in
connect-result
by the
APS_ASSOC_GETPARAM_ procedure means that all necessary service providers
are available and that the remote application has accepted the connection.
Similarly, a remote application can request to be connected to your application. To be
notified of such requests, you call APS_ASSOC_ATTACH_ to indicate that you are
ready to establish a connection initiated by a remote application, specifying in
service-id
whether this should be a session, presentation, or ACSE connection.
Your application can have a number of connections active simultaneously with the
same or different remote applications. Each connection is identifiable to your
application by a CEPI allocated by the API.
The following subsections describe in more detail the two types of connection
establishment: establishing a connection as the calling user, and establishing a
connection as the responding user.