HP-UX SNAplus2 R7 LUA Programmer's Guide

Concepts
A Sample LUA Communication Sequence
If the application does not provide an SDT routine, LUA returns a positive response.
1.4.3 Asynchronous Verb Completion
Some LUA verbs complete quickly, after some local processing (for example the RUI_PURGE verb); however, most
verbs take some time to complete, because they require messages to be sent to and received from the node or from
the host application. Because of this, LUA is implemented as an asynchronous interface; control can be returned
to the application while a verb is still in progress, so the application is free to continue with further processing
(including issuing other LUA verbs).
UNIX
When the verb completes, LUA calls a callback routine supplied by the application. This routine may perform
further processing on the returned data, issue further LUA verbs, or simply act as an indicator that the verb has
completed.
RUI verbs may complete synchronously or asynchronously. The application should check the primary return
code in the VCB to determine which completion mode applies for each verb.
SLI verbs always complete asynchronously. After issuing the verb, the application must not access the VCB
until its callback routine has been called. It can process the VCB either from within the callback routine, or
from the programs main thread of execution after the callback routine has completed.
WINDOWS
When the verb completes, LUA either posts a message to a window handle supplied by the application or signals
an event handle supplied by the application.
For more information, see Chapter 2, Designing and Writing LUA Applications.
1.5 A Sample LUA Communication Sequence
Figure 13, RUI Communication Sequence, shows a sample LUA communication sequence using RUI verbs, and
Figure 14, SLI Communication Sequence, shows the equivalent sequence using SLI verbs.
In the RUI example, the application performs the following steps:
1. Issues the RUI_INIT verb to establish the SSCP session. The RUI_INIT verb does not complete until SNAplus2
has received an activate logical unit (ACTLU) message from the host and sent a positive response; however,
these messages are handled by SNAplus2 and not exposed to the LUA application.
2. Sends an INITSELF message to the SSCP, to request a BIND, and reads the response.
3. Reads a BIND message from the host, and writes the response. This establishes the LU session.
4. Reads an SDT message from the host, which indicates that initialization is complete and data transfer can begin.
5. Sends a chain of data consisting of three RUs (the last indicates that a denite response is required), and reads
the response.
6. Reads a chain of data consisting of two RUs, and writes the response.
7. Reads an UNBIND message from the host, and writes the response. This terminates the LU session.
8. Issues the RUI_TERM verb to terminate the SSCP session. (SNAplus2 sends a NOTIFY message to the host
and waits for a positive response; however, these messages are handled by SNAplus2 and not exposed to the
LUA application.)
19