HPlogo LU 6.2 API Application Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 Buffer Management

Receive Buffer

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

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 “Receiving Data and Changing State” illustrates this example.

Figure 6-3 Receiving Data and Changing State

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 “Receiving Large Data Records” 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 “Receiving Large Data Records”.)

Figure 6-4 Receiving Large Data Records

Receiving Large Data Records
Feedback to webmaster