Pathway/iTS TCP and Terminal Programming Guide
Processing Unsolicited Messages
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
7-13
Message Processing Requiring Both Input and
Output
Message Processing Requiring Both Input and Output
The next example illustrates a case when the arrival of an unsolicited message requires 
that information be displayed on the terminal where I/O was interrupted and that the 
terminal operator enter a reply.
Following message processing, the program reissues the interrupted ACCEPT operation. 
Because the unsolicited message required operator input, the previous cursor position is 
lost and the operator has to reposition the cursor manually at the appropriate screen 
location.
For brevity, error handling has been omitted from the example.
 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.
* The operator might have to reposition the cursor or 
* reissue a function-key stroke.
 MAIN-INPUT.
 ACCEPT normal-screen-data UNTIL f5
 ESCAPE ON UNSOLICITED MESSAGE.
 PERFORM ONE OF
 normal-processing
 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.
* Accept, process, and reply to unsolicited message.
 RECEIVE UNSOLICITED MESSAGE YIELDS rcv-msg.
* Set up window for operator response.
 DISPLAY urgent-op-overlay.
* Accept operator input to urgent overlay.
 ACCEPT ws-urgent-op-reply UNTIL f1.
 MOVE ws-urgent-op-reply TO reply-msg-op-reply.
* Reply to sender with operator's response.
 REPLY TO UNSOLICITED MESSAGE WITH reply-msg.










