Pathway/iTS TCP and Terminal Programming Guide

Processing Unsolicited Messages
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide426751-001
7-11
Message Processing Requiring No Terminal
Interaction
Message Processing Requiring No Terminal Interaction
Assume that an ACCEPT statement issued by a standard requester controlling a
supported block-mode terminal is interrupted by the arrival of an unsolicited message.
Also assume that the message requires no terminal input-output. For example, the
message asks the requester to return statistics maintained in its working storage.
The applicable UMP-code constructs for handling this situation are as follows:
PROCEDURE DIVISION.
MAIN-LOOP.
DISPLAY BASE name-screen.
MAIN-INPUT.
ACCEPT name-screen
UNTIL f1
ESCAPE ON
TIMEOUT one-hour
UNSOLICITED MESSAGE.
PERFORM ONE OF
normal-f1-completion
operation-timed-out
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 receive-msg.
* Build the reply.
REPLY TO UNSOLICITED MESSAGE WITH reply-msg.
* Prevent the ACCEPT statement from moving the cursor.
MOVE "NO" TO PW-USE-NEW-CURSOR.