SNAX/APC Application Programming Manual

Using the Application Program Interface
SNAX/APC Application Programming Manual138786
1-13
Initial Environment
Once a resource ID has been assigned by SNAX/APC and returned to a TP in a
TP-READY reply, that resource ID is used by the TP until the TP issues a TP-END
request specifying that resource ID.
A multithreaded TP can establish a number of concurrent conversations by issuing TP-
READY requests to multiple single-session LUs, or multiple TP-READY requests to the
same parallel-session LU. The RESOURCE-ID field in the IPC header for each new
conversation (each TP-READY request) must contain all zeros. The TP then uses the
returned resource IDs to identify the individual conversations.
If the returned resource ID contains zeros, there are no resources. When the resource ID
is zero, the only verb the TP can issue is TP-READY. Each instance of TP-READY
must be issued in a separate open to SNAX/APC.
Releasing Conversation Resources
Each SNAX/APC process has resources to handle up to 1024 conversations. When a TP
establishes communication with a local LU (by using a TP-READY request), it
consumes one set of resources. Each set of resources is identified by a resource ID.
When TPs are using all 1024 conversation resources, no further conversations can be
established for that SNAX/APC process. A TP must release the resources allocated to it
before those resources can be used by another TP.
A TP can release the resources allocated to it in different ways:
The TP can issue a TP-END request. The resources associated with the resource ID
specified in the TP-END request are released.
The TP can close SNAX/APC. A close is handled according to whether or not there
are outstanding verbs when the close is issued.
If there are no outstanding verbs, SNAX/APC releases all resources allocated to
the TP. If the TP has opened SNAX/APC several times using a different
qualified open each time, only the resources associated with the qualified open
that was closed are released. If the TP has opened SNAX/APC several times
using the same open each time, no resources are released until the last open is
closed.
If there are outstanding verbs when the TP attempts to close SNAX/APC and
CANCELSUPPORT is OFF, then no resources are released until the verb
completes. (The session is hung until the verb completes or until a
DEACTIVATE-SESSION command is issued to end the session.)
If the TP closes SNAX/APC and CANCELSUPPORT is ON, SNAX/APC will
cancel any outstanding requests (deactivating the session if required) and release
the resources.
The Impact of Multiple Sessions
Given that there could be multiple sessions in existence, it is important to know a
particular session’s ID before you deactivate it. You must acquire the session ID before
the end of the conversation. The order of commands is as follows: