SNAX/APC Application Programming Manual
Using the Application Program Interface
SNAX/APC Application Programming Manual—138786
1-25
Changing Send and Receive States
•
If WHAT-RECEIVED indicates CONFIRM-DEALLOCATE (value 6), the TP
must issue a CONFIRMED or SEND-ERROR verb request to the remote TP.
•
If the CONFIRMED verb request completes successfully, the TP enters
Deallocate state and must issue a DEALLOCATE LOCAL verb request.
•
If a TP issues a SEND-ERROR verb request in response to CONFIRM,
CONFIRM-SEND, or CONFIRM-DEALLOCATE, the TP enters Send
state. The remote TP receives error notification as a return code in the form
PROGRAM-ERROR-xxx (PROGRAM-ERROR-NO-TRUNC, PROGRAM-
ERROR-PURGING, and PROGRAM-ERROR-TRUNC).
Further processing depends on the conventions of the transaction. After handling the
error, the remote TP can either issue another RECEIVE-AND-WAIT request or
terminate the conversation.
Changing Send and Receive States
There are times when a local or remote TP must change the direction in which data is
flowing; that is, it must change from Send to Receive state or from Receive to Send
state. This subsection first describes how a local TP can request a state transition, and
then it describes how to handle a request for a state transition from the remote TP.
Note that verbs may be mapped or basic—this is indicated by an (MC) prefix, thus
(MC)SEND indicates that either SEND or MC-SEND may be used.
How to Change Send and Receive States
When the local TP in Send state has finished sending data, it can issue the
(MC)RECEIVE-AND-WAIT verb or the (MC)PREPARE-TO-RECEIVE verb to give
the remote TP a chance to send data. Issuing the (MC)RECEIVE-AND-WAIT verb or
the (MC)PREPARE-TO-RECEIVE verb also causes SNAX/APC to transmit any
untransmitted data in the send buffer.
A local TP in Receive state can request a transition to Send state by issuing the
(MC)REQUEST-TO-SEND verb. The remote TP receives notification that the local TP
has data to send. When it is ready, the remote TP issues the (MC)RECEIVE-AND-
WAIT verb or the (MC)PREPARE-TO-RECEIVE verb, which places the local TP in
Send state.
After the local TP issues the REQUEST-TO-SEND verb, it must continue to issue
(MC)RECEIVE-AND-WAIT or (MC)RECEIVE-IMMEDIATE verbs until it receives a
send indication (value 3 or 5) in the WHAT-RECEIVED field of the reply.
A reply that contains the SEND indication does not contain any data. Figure 1-8
depicts
the verb flow for requesting a change to Send state.