Pathway/iTS TCP and Terminal Programming Guide
Processing Unsolicited Messages
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
7-12
Message Processing Requiring Only Terminal
Output
Message Processing Requiring Only Terminal Output
The next example illustrates the case where the arrival of an unsolicited message
requires the displaying of information on the terminal whose I/O operation was
interrupted. Assume that the unsolicited message contains latest price information that
must be displayed to the terminal.
Following message processing, the program reissues the interrupted ACCEPT operation.
PROCEDURE DIVISION.
MAIN-LOOP.
DISPLAY BASE normal-screen.
* The following ACCEPT operation is reissued when
* unsolicited-message processing is complete. At that time,
* any data typed on the screen is preserved. At worst,
* the operator will have to reissue a single function-key
* stroke.
MAIN-INPUT.
ACCEPT normal-screen UNTIL f5
ESCAPE ON UNSOLICITED MESSAGE.
PERFORM ONE OF
normal-f5-completion
unsolicited-message-arrival
DEPENDING ON termination-status
GO TO main-input.
UNSOLICITED-MESSAGE-ARRIVAL.
IF PW-UNSOLICITED-MESSAGE-QUEUED IS EQUAL TO "YES"
PERFORM process-unsolicited-message
UNTIL PW-UNSOLICITED-MESSAGE-QUEUED IS EQUAL TO "NO".
PROCESS-UNSOLICITED-MESSAGE
RECEIVE UNSOLICITED MESSAGE YIELDS rcv-msg.
* Reply immediately to sender because no actual information
* is contained in the reply.
* Shorten the wait for $RECEIVE response.
REPLY TO UNSOLICITED MESSAGE WITH reply-msg.
* Set up screen to request system status.
MOVE CORRESPONDING price-info OF rcv-msg
TO latest-prices.
* The latest information displays on the screen; operator
* continues screen interaction.
DISPLAY latest-price-overlay.
* Prevent the ACCEPT statement from moving the cursor.
MOVE "NO " TO PW-USE-NEW-CURSOR.