|
|
|
|
This chapter introduces the fundamental concepts of advanced program-to-program communication (APPC) in a distributed processing environment:
What is APPC?
A simple mapped conversation
Confirmation processing
Sending and receiving status with data
Conversation states
Changing conversation states
Synchronous and asynchronous APPC calls
Receiving data asynchronously
Syncpoint support
APPC and CPI-C (Common Programming Interface for Communications)
TP Server API
APPC stands for Advanced Program-to-Program Communication, an application program interface (API) that enables peer-to-peer communications among programs in a Systems Network Architecture (SNA) environment.
Through APPC, application programs distributed across a network can work together, communicating with each other and exchanging data to accomplish a single processing task such as the following:
Querying a remote database
Copying a remote file
Sending or receiving electronic mail
Two communicating APPC applications can be on the same computer or on two separate computers; an application does not need to know where its partner application is located. An APPC application can run either on a server or on a client computer.
A transaction is a processing task accomplished by programs using APPC. Consequently, programs that use APPC are called transaction programs (TPs). These programs communicate as peers, on an equal (rather than a hierarchical) basis. Application TPs accomplish tasks for end users. Service TPs provide services to other programs.
Together, TPs distributed across a local- or wide-area network perform distributed transaction processing.
Many hardware and software elements in the SNA environment are required for two TPs to communicate with each other. Elements for Writing TPs illustrates the elements that pertain directly to programmers writing TPs.
Each TP is associated with a logical unit (LU) on a particular SNAP-IX local node and accesses the network through that LU. Several TPs can be associated with the same LU. Each LU type uses a specific protocol. APPC is supported by LU 6.2.
Before two TPs can communicate, their LUs must be connected through an LU-to-LU session. An LU-to-LU session is a logical connection between the two LUs. The session's mode (set of networking characteristics) determines how data moves between the two LUs.
The communication between the two TPs occurs as a conversation within the LU-to-LU session. A TP can be involved in several conversations simultaneously.
A TP accesses APPC through APPC verbs. The TPs use these verbs to instruct APPC to start a conversation, send or receive data, and end a conversation. Each verb supplies parameters to APPC, which performs the desired function and returns parameters to the TP. Some verbs complete quickly, after some local processing (for example sending a small amount of data); other verbs may take some time to complete, depending on the partner TP and the communications path (for instance, waiting for data or confirmation from the partner TP).
The TP issuing the verb is referred to as the local TP; the other TP is referred to as the partner TP.
Similarly, the LU serving the local TP is the local LU and the LU serving the partner TP is the partner LU.
TPs and LUs residing on other network nodes are also called remote TPs and remote LUs.
A conversation begins when both of the following happen:
One TP (the invoking TP) instructs APPC to start another TP (the invoked TP) and allocate a conversation between the two TPs.
The invoked TP notifies APPC that it is ready to communicate with the invoking TP.
During the conversation, the two TPs exchange status information and application data.
A conversation ends when a TP instructs APPC to deallocate the conversation.
A conversation can be mapped or basic. At allocation time, the invoking TP specifies whether a conversation is to be basic or mapped. Certain APPC verbs are used in mapped conversations only; others are used in basic conversations. You cannot use a basic-conversation verb in a mapped conversation or vice versa.
In general, mapped conversations are used by application TPs. Application TPs are programs that accomplish tasks for end users. Mapped conversations are less complex than basic conversations. In a mapped conversation, the sending TP sends one record at a time: the receiving TP receives one record at a time.
Basic conversations are normally used by service TPs. Service TPs are programs that provide services to other local programs. Basic conversations provide an experienced LU 6.2 programmer with a greater degree of control over the transmission and handling of data. For more information, see Basic Conversations.
A TP can be involved in several conversations simultaneously. Each conversation requires an LU-to-LU session.
A common use of multiple conversations is for an invoked TP to invoke another TP, which, in turn, invokes another TP, and so on. Invoking TPs Using Multiple Conversations shows how TP A invokes TP B, and TP B then invokes TP C. TPs A and C are not in conversation with each other, but only with TP B.
|
|
|
|
|