Pathway/iTS TCP and Terminal Programming Guide

Processing Unsolicited Messages
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide426751-001
7-2
Detecting the Arrival of Unsolicited Messages
Detecting the Arrival of Unsolicited Messages
Each requester program has its own unsolicited-message queue. In addition, each
requester program has its own copy of the PW-UNSOLICITED-MESSAGE-QUEUED
special register that is global to any program units called by that requester.
When the TCP receives an unsolicited message addressed to one of its requesters, it
places the message in the appropriate queue and sets the value of the associated
PW-UNSOLICITED-MESSAGE- QUEUED register to YES.
A requester can detect the arrival of an unsolicited message in any of the following
ways:
By testing the content of its PW-UNSOLICITED-MESSAGE-QUEUED special
register
YES signifies that one or more messages have arrived and are waiting to be
processed; NO signifies that the queue is empty.
By performing a RECEIVE UNSOLICITED MESSAGE statement as a waited input
operation
By including an ESCAPE ON UNSOLICITED MESSAGE clause in ACCEPT or
SEND MESSAGE statements
Accepting Unsolicited Messages
Requesters obtain the text of an unsolicited message by performing a RECEIVE
UNSOLICITED MESSAGE statement. Messages can move either directly into
working-storage or move indirectly there from a Message Section templates.
Replying to Unsolicited Messages
When a requester has constructed an appropriate response message, it replies to an
unsolicited message by performing a REPLY TO UNSOLICITED MESSAGE
statement. After replying to the message, the requester is then free to accept and process
another unsolicited message.
Having received one message (by performing a RECEIVE UNSOLICITED MESSAGE
statement), the requester cannot perform another RECEIVE UNSOLICITED
MESSAGE statement until it has replied to the first message (by using a REPLY TO
UNSOLICITED MESSAGE statement).