Previous Topic: Send a Data Buffer to a Receiver

Next Topic: Purge the Data Buffer

Allow a Receiver to Receive a Data Buffer

To allow a defined, active receiver to receive a data buffer, use request code 22. The next buffer in the receiver buffer queue is made available in the user-provided area.

The RPB fields in the following table must be set up before the call:

Bytes

Field Name

Set to...

00–03

RPLEN

56.

04–05

REQUEST

22.

06–07

RECOPT

A recovery option as required.

12–15

WORKADDR

The address of a 128-byte work area.

16–19

ASCBADDR

The receiver ASCB address.

20–23

ECBADDR

The receiver ECB address—this field is set only when RETCODE 30 is returned.

24–31

RECVERID

The target receiver ID.

32–35

BUFFLEN

The length of the data buffer to send.

36–39

BUFFADDR

The address of the data buffer to send.

The RPB fields in the following table are returned after the call:

Bytes

Field Name

Set to...

08–11

RETCODE

The return code.

16–23

SENDERID

The ID of the sender of this buffer.

32–35

BUFFLEN

The actual data buffer length.

The following return codes are possible:

0

Request completed successfully.

22

The requestor is not in primary addressing mode.

24

PPI is not active.

25

The ASCB address is not correct.

26

The receiver program is not defined.

28

PPI requests are not supported.

30

No data buffers are in the receiver buffer queue.

31

The receiver buffer size is not large enough for the incoming data buffer.

33

Buffer length is invalid.

35

The receiver buffer queue is full.

36

ESTAE could not be established as requested.

40

Sender ID is invalid.

90

A processing error occurred.

The correct ASCB address is required. This address is the ASCB address provided when the receiver was defined.

One data buffer at a time can be received. They are provided first-in-first-out order. If the call is successful, the sender ID of the sending program is provided.

The length of the incoming buffer is provided in the BUFFLEN field after the call. If a return code 31 (buffer too small) is given, BUFFLEN contains the required length to receive the buffer successfully. The call can be reissued after obtaining a large enough buffer.

If no data is queued, a return code of 30 is given and the ECBADDR field is set to the ECB address, as returned by DEFINE RECEIVER. The receiver can wait (using the WAIT macro or request code 24) until more data arrives.