OSI/AS Programming Manual

Sending and Retrieving User Data
APS Procedures Programming Concepts
056783 Tandem Computers Incorporated 2–35
You can include as many data elements as you wish. Each data-element header must
start on a word boundary.
The following conceptual example in TAL declares two data-element headers and two
fixed-length data elements, one of 20,000 bytes and one of 30,000 bytes. (Since data
elements are of variable length, most real applications will dynamically calculate the
address of each data-element header after the first.)
STRUCT user^data (*);
BEGIN
STRUCT header (ZAPS^DDL^DATA^HDR^DEF)
STRUCT element1 (ZAPS^DDL^DATA^ELEMENT^HDR^DEF)
STRING value1 [0:19999]
STRUCT element2 (ZAPS^DDL^DATA^ELEMENT^HDR^DEF)
STRING value2 [0:29999]
END;
You must decide how large a buffer you need. For data you send, the maximum
length of the user data depends on several factors, as described in the following
subsection, “Sending User Data.” By using the APS_DATA_REQ_ or
APS_TYPEDDATA_REQ_ procedure, you can send an unlimited amount of user data
(that is, as much data as your program can handle) by making multiple procedure
calls.
If incoming data is too long to fit the buffer, you must call APS_DATA_GETPARAM_
more than once, as described in “Retrieving User Data,” later in this section.
Note The phrase “unlimited-length user data” implies that at least 2 MB of data can be sent or retrieved. For
sending data, OSI/AS extends this maximum to an unlimited amount of user data. Incoming session user
data is limited to 2 MB.
Defining User Data Buffers For ACSE and Presentation Connections
OSI/AS defines two categories of PDV types: single ASN.1 and octet-aligned. In the
simplest terms, each PDV list can contain either of the following:
A single ASN.1 PDV
Two or more octet-aligned PDVs (all with the same PCID)