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

Chapter 6 133
Buffer Management
Receive Buffer
Figure 6-3 Receiving Data and Changing State
Example 4: Receiving Large Data Records
In example 4, the remote TP has a large send buffer, and the data
records that it sends to the local TP are 5000 bytes long. The local
receive buffer will hold 4092 bytes. It is too small to receive a complete
data record, so the local TP must call MCRcvAndWait or MCRcvNoWait
twice to receive a complete record: once to receive the first 4092 bytes,
and a second time to receive the remaining 908 bytes of the 5000-byte
record.
When the local TP calls MCRcvAndWait or MCRcvNoWait the first time,
the
WhatReceived
parameter returns DATA_INCOMPLETE, telling
the local TP that it has received an incomplete data record and must
make another intrinsic call to receive the rest of the record. When the
local TP receives the last 908 bytes, the
WhatReceived
parameter
returns DATA_COMPLETE, telling the local TP that it has received
the end of a data record. Figure 6-4 illustrates this example.
NOTE
If the local TP will be receiving data records larger than the receive
buffer, it must allocate more than one location for storing data. Data
received in the
Data
parameter during the first call to MCRcvAndWait or
MCRcvNoWait will be overwritten during the second call unless it is
moved to another location. (See Figure 6-4.)