LU 6.2 API Application Programmer's Reference Guide (30294-90008)

132 Chapter6
Buffer Management
Receive Buffer
Receive Buffer
Unless the data records exchanged by TPs are very large, they are
transmitted and received in groups of more than one at a time.
However, a TP can logically send and receive only one record at a time.
So each group of records that a TP receives is stored in its receive
buffer, and the TP takes the records out of the receive buffer one at a
time.
LU 6.2 API allocates a receive buffer for every active conversation. On
MPE V, the size of the receive buffer is 4092 bytes. On MPE XL, the
receive buffer is a different size depending on which intrinsic you call to
receive data. On MPE XL, the MCRcvAndWait intrinsic uses a
32763-byte receive buffer, and the MCRcvNoWait intrinsic uses a
4092-byte receive buffer.
Because MCRcvAndWait and MCRcvNoWait can receive control
information as well as data, an additional area is assigned with the
receive buffer. This area contains the state the TP is to enter once it
receives all the data from the receive buffer.
NOTE
Hewlett-Packard’s implementation of LU 6.2 API does not allow data
and control information to be received on the same intrinsic call. Other
LU 6.2 implementations may allow data and control information to be
received at the same time. This could affect how the TP must be
designed at the remote location.
Example 3: Receiving Data and Changing State
In example 3, the remote TP is sending 80-byte data records during a
two-way conversation without confirm. When the remote TP is finished
sending data, it issues the equivalent of the MCRcvAndWait intrinsic,
which flushes its send buffer and tells the local TP to enter Send state.
The data and the state change instruction are transmitted to the local
receive buffer. The local TP receives the data from the receive buffer
through calls to MCRcvAndWait or MCRcvNoWait. After the local TP
receives all the data, one record at a time, it calls MCRcvAndWait once
more to receive the instruction to change to Send state. When the
MCRcvAndWait intrinsic returns, the state indicator flag is updated to
reflect the new state. Figure 6-3 illustrates this example.