Envoy Application Programming Manual

Table Of Contents
Asynchronous Line Supervisor Protocol
Envoy Application Programming Manual427159-001
10-16
READ Buffering
READ Buffering
This protocol uses a dedicated buffer to receive data from a communications line. The
size of the dedicated buffer is set with the buffer size entry using SYSGEN. This entry
specifies the number of words to be allocated. The buffer is divided dynamically during
requests.
A READ request is an initial READ if:
1. Envoy is not in an active READ state, and
2. The buffer does not contain a block of data to be returned with a READ request
An initial READ determines the buffer blocking according to the length parameter of the
READ procedure. For example, if a line has a dedicated buffer of 1024 words and an
initial READ request has a length of 128 characters, then the buffer is divided into eight
127-word READ buffer blocks. The use of READ buffers by Normal and READ-Only
lines is shown in Table 10-12
.
The dedicated buffer can be divided into 2 to 15 equal blocks. If the length of the READ
request is more than half the size of the buffer, the buffer still has two blocks.
The number of words required for a READ request is the number of characters minus
one. For example, a 128 character READ requires 126 words for the characters received,
plus 1 word for the MCW. The calculation is:
X = number of characters to read
X + 2 = length of read request
X + 1 = number of words per buffer block
171 No response received. The line did not receive any message during
defined timeout period. READ still active on line. Not returned by
READ continuous lines.
173 Transmission error. The line detected a parity error and the read aborted.
177 Text overrun. Data overrun occurred in the line buffer and the READ
aborted.
Table 10-12. READ Buffers and Normal Read Versus Read-Only Lines
Line Type Buffers
Normal Read The buffer remains divided into blocks until another initial READ
request is issued.
Read-Only The buffer is divided until the line is closed and reopened, or until a
SETMODE 16 request with the same line type is issued.
Table 10-11. File-System Errors After a READ (page 2 of 2)
Error Numbers Description