Exchange/SNA Manual
Programming Considerations
Using the Exchange/SNA Programmatic Interface
104700 Tandem Computers Incorporated 4–5
Designing Console
Programs
You use a console application to exchange console messages with the host. You may
design your program to both send and receive console messages or to only receive
messages. You cannot use the application only to send messages because
Exchange/SNA expects all console applications to read the messages, which are
queued in buffers. If the messages are not read, Exchange/SNA runs out of buffers
and then cannot process any requests on any subdevice.
When you are designing your application, you should consider the following:
Many messages are asynchronous; they are not in response to a request from your
application. They may be responses to another application using the same line
server or they may have been generated by the host. The console is a broadcast
medium. Your application must be prepared to accept messages at any time and
must be able to handle any messages that arrive.
A single console command can produce many lines of output from the host. Each
READ call returns a single line of output. Therefore, a single call to WRITE
(containing a single console command) can require many calls to READ to receive
all the output.
Responses to a request do not end with an end-of-transmission marker of any
kind. Your application must keep calling READ until nothing comes back. The
application should periodically call AWAITIO to see if any messages are present.
Only one I/O request can be outstanding against the console.
In general, then, your application should have an outstanding READ call at all times.
In addition, note that there is no logical end to console output; your application should
keep calling READ until it stops.
For a step-by-step outline of the console application flow, see the subsection “Console
Operations,” later in this section.