HP-UX SNAplus2 R7 APPC Programmer's Guide
Concepts
Full-Duplex Conversations
1.7.3 Receiving Data
The MC_RECEIVE_AND_WAIT verb receives data from the partner TP. If no data is currently available, the local
TP waits for it to arrive.
As well as receiving data, the verb may receive a status indicator from the partner TP (such as an indication that
the conversation is ending). For more information about how the TP handles these indicators, see Section 1.7.4,
Ending a Conversation.
In the example, the invoked TP issues the first MC_RECEIVE_AND_WAIT verb to receive data, and receives the
complete data record (what_rcvd=
AP_DATA_COMPLETE
).
The MC_RECEIVE_IMMEDIATE verb performs the same function as the MC_RECEIVE_AND_WAIT verb,
except that it does not wait if data is not currently available from the partner TP. Instead, it returns a no-data-
available response to the calling TP.
1.7.4 Ending a Conversation
To end a conversation, one of the TPs issues the MC_DEALLOCATE verb, indicating that it has no more data to
send. The other TP receives the return code
AP_DEALLOC_NORMAL
on a subsequent receive verb, indicating that
the conversation was deallocated.
In a half-duplex conversation, the MC_DEALLOCATE verb causes APPC to deallocate the conversation between
the two TPs, so that the other TP cannot continue the conversation after it has received the
AP_DEALLOC_NORMAL
return code. However, in a full-duplex conversation, the other TP may still have data to send, or may already have
sent data that the first TP has not yet received. For this reason, the conversation does not end at this point; instead,
the first TP operates in receive-only mode, so that it continues to issue receive verbs (but cannot send any further
data).
When the second TP receives the
AP_DEALLOC_NORMAL return code, it now operates in send-only mode. It cannot
issue any more receive verbs (because there will be no more data to receive), but it can continue to send data. In
the example, the invoked TP issues another MC_SEND_DATA verb before deallocating the conversation.
After both TPs have deallocated this conversation, each TP either issues another [MC_]ALLOCATE or RE-
CEIVE_ALLOCATE verb to start another conversation (with this or another partner TP), or issues the TP_ENDED
verb.
A TP can participate in multiple conversations simultaneously. In this case, the TP issues the TP_ENDED verb
when all conversations have been deallocated.
1.7.5 Conversation States
A TP regards a full-duplex conversation as being in a particular conversation state, in the same way as for a half-
duplex conversation. However, the possible conversation states in a full-duplex conversation are different from those
in a half-duplex conversation, as follows. For more information about the APPC verbs that can be issued in each
state, see Appendix C, APPC State Changes.
Following is a list of possible conversation states:
Send-Receive
The TP can send data or error information, and can receive application data and status information from the
partner TP.
Receive-Only
The local TP has deallocated the conversation. It can continue to receive data and status information from
the partner TP, but cannot send any further data.
Send-Only
The remote TP has deallocated the conversation. The local TP can continue to send data to the partner TP,
but will not receive any further data and so is not permitted to issue any further receive verbs.
35