SNAX/APC Application Programming Manual

Using the Application Program Interface
SNAX/APC Application Programming Manual138786
1-28
GDS Variables and TP Data
Note that SNAX/APC buffering is totally transparent to the receiving TP. The receiving
TP’s RECEIVE-AND-WAIT verb request completes only when its buffer is full or when
it receives one complete logical record (depending on the fill code).
GDS Variables and TP Data
When a TP sends or receives data using SNAX/APC, it must format or interpret GDS
variables. The SEND-DATA, RECEIVE-AND-WAIT, and RECEIVE-IMMEDIATE
verb requests include a data length field in addition to the LL field in the GDS header:
For the SEND-DATA verb request, the length field represents the number of bytes
being sent to the remote TP.
For the RECEIVE-AND-WAIT and RECEIVE-IMMEDIATE verb requests, the
length field represents the maximum number of bytes that can be received at one
time (the RECEIVE-AND-WAIT and RECEIVE-IMMEDIATE replies contain the
actual number of bytes received).
If a TP sends one logical record, the value in the LL field equals the send length (the
same is true for RECEIVE-AND-WAIT and RECEIVE-IMMEDIATE).
Figure 1-9
illustrates how TPs use GDS variables to transmit data (see following page).
In the example, a TP needs to send a record that is 300 bytes long. The largest record
that the TP can send is 200 bytes. The TP can send the record in two parts. The first
part is 200 bytes long (including 4 bytes for the LLID fields). The LL field in the GDS
header contains the value 304 (300 bytes of data plus 4 bytes for the GDS header). The
DATA-LENGTH field in the SEND-DATA verb request contains the value 200.
The second part, which contains the remaining data, is 104 bytes long (304 minus 200).
SNAX/APC splits the data into records, the size of which depends on the RU size
specified in the BIND request. SNAX/APC then sends the data to the remote LU.
The receiving TP issues a series of RECEIVE-AND-WAIT verb requests, specifying
APC-FILL-LL (indicating that it expects one, or a portion of one, logical record). The
receiving TP specifies a maximum length of 128 bytes; thus, it issues three RECEIVE-
AND-WAIT verbs.
When the first RECEIVE-AND-WAIT verb request completes, it indicates that it
received 128 bytes of data and WHAT-RECEIVED contains DATA-INCOMPLETE.
The first 4 bytes of the data buffer contain the GDS header. The second RECEIVE-
AND-WAIT verb request also completes with 128 bytes of data and WHAT-RECEIVED
contains DATA-INCOMPLETE. The third RECEIVE-AND-WAIT verb request
completes with 48 bytes of data and WHAT-RECEIVED contains DATA-COMPLETE,
because the TP has received an entire logical record.