HP-UX SNAplus2 R7 LUA Programmer's Guide

Designing and Writing LUA Applications
SNA Information for RUI Primary
If the host species exception response only (a negative response can be sent but a positive response should not
be sent), SNAplus2 must still keep a record of the request in case the application subsequently sends a negative
response. If the application does not send a response, the storage associated with this request cannot be freed.
Because of this, SNAplus2 allows the LUA application to issue a positive response to an exception-response-only
request from the host (this is known as a courtesy acknowledgment). The response is not sent to the host, but is
used by SNAplus2 to clear the storage associated with the request.
2.4.8 Purging Data to End of Chain
When the host sends a chain of request units to an LUA application, the application may wait until the last RU in
the chain is received before sending a response, or it may send a negative response to an RU that is not the last in
the chain. If a negative response is sent mid-chain, SNAplus2 purges all subsequent RUs from this chain, and does
not send them to the application.
When SNAplus2 receives the last RU in the chain, it indicates this to the application by setting the primary return
code of an RUI_READ or RUI_BID verb, or SLI_RECEIVE / SLI_BID, to
LUA_NEGATIVE_RSP
with a
0 (zero)
secondary return code.
The host may terminate the chain by sending a message such as CANCEL while in mid-chain. In this
case, the CANCEL message is returned to the application on an RUI_READ or SLI_RECEIVE verb, and the
LUA_NEGATIVE_RSP
return code (see Section 2.4.3,
Negative Responses and SNA Sense Codes) is not used.
2.5 SNA Information for RUI Primary
This section explains some SNA information that you need to consider when writing SNAplus2 RUI Primary
applications for communications with a downstream LU.
This guide does not attempt to explain SNA concepts in detail. If you need specic information about SNA message
ows, refer to the documentation listed in Related Publications, and to the documentation for the host application
for which you are designing your SNAplus2 LUA application.
2.5.1 Responsibilities of the Primary RUI application
A Primary RUI application has control of both LU-SSCP and PLU-SLU sessions at the Request/Response Unit
(RU) level, and can send and receive SNA RUs on these sessions. The PU-SSCP session is internal to SNAplus2
and the Primary RUI application cannot access it.
Because a Primary RUI application works at the RU level, it has a large degree of control over the data ow to
and from the secondary LU. However, it takes greater responsibility than a regular LUA application for ensuring
that the SNA messages it sends are valid and that the RU level protocols (for example bracketing and chaining) are
used correctly. In particular, note that SNAplus2 does not attempt to verify the validity of RUs sent by a Primary
RUI application.
The Primary RUI application is responsible for:
Initializing downstream LUs using RUI_INIT_PRIMARY, and terminating them using RUI_TERM
Processing NOTIFY messages from the secondary LU as secondary applications start and stop
Processing INIT-SELF and TERM-SELF to activate and deactivate the PLU-SLU session
Building, sending, receiving and parsing 3270 datastream messages in data RUs
Implementing RU level protocols (request control, bracketing, chaining, direction)
Cryptography (if required)
47