SNAX/APC Application Programming Manual

Using the Application Program Interface
SNAX/APC Application Programming Manual138786
1-20
DISPATCHED Request Example
2. The SNAX/APC process receives an ALLOCATE request from the partner LU for a
specific local TP that has not been started. The SNAX/APC process queues the
ALLOCATE request until it receives a TP-READY from the requested TP.
3. The SNAX/APC process dequeues the DISPATCHER-READY request and sends a
DISPATCHER-READY reply to the SNAX/APC Dispatcher. The reply includes the
name of the requested TP.
4. The SNAX/APC Dispatcher uses the information in the Dispatcher reply to create a
DISPATCH-TP verb request, which it sends through the PATHMON process to the
TP server class. If an available link to an existing TP exists, that TP receives the
DISPATCH-TP verb request; otherwise, the PATHMON process creates a new
instance of the TP to receive the DISPATCH-TP verb request.
5. Upon startup, the local TP opens $RECEIVE and receives the DISPATCH-TP
request. Note that like all other UOWs, the DISPATCH-TP request is preceded by
an IPC header.
The local TP reads the name of the dispatching SNAX/APC server from the
DISPATCH-TP message (DD-DISPATCHING-PROCESS) and opens that process
for I/O. (Note that COBOL TPs must use the dynamic assign facility before
opening the SNAX/APC server process; the COBOL OPEN request should use the
I-O and SHARED options.)
The local TP uses the name of the local LU (DD-DISPATCHING-LUNAME) for
the TP-READY request. The TP-READY request must specify that it is not a local
attach and that it was dispatched (LOCAL-ATTACH=N, DISPATCHED=Y).
6. When the SNAX/APC process receives the TP-READY request, it dequeues the
ATTACH request and sends a TP-READY reply back to the local TP server. At this
point, the TP server must issue a RECEIVE-AND-WAIT conversation verb to
receive the data from the remote TP.
When the local TP receives the TP-READY reply, it is in Receive state and can issue
a GET-ATTRIBUTES call to obtain information about the remote LU.
The local TP should issue a GET-TYPE verb to determine the conversation type:
basic or mapped. The local LU will respond.
7. When the conversation is terminated (either by the local or remote TP), the local TP
must send a DISPATCH-TP reply to the Dispatcher.
The DISPATCH-TP reply must be preceded by an IPC header. The local TP must
set the RETN-CODE field of the IPC reply header to ALL-UOWS-OK (0). Note
that the size of the buffer containing the IPC reply must be exactly as long as the
reply. The buffer cannot be longer than the reply because the Dispatcher is written
in SCREEN COBOL and SCREEN COBOL requires exact reply lengths. When the
Dispatcher receives the DISPATCH-TP reply, it sends a new DISPATCHER-
READY request to the SNAX/APC server, thereby notifying the SNAX/APC server
that the Dispatcher is available again.
After sending the DISPATCH-TP reply, the TP should read $RECEIVE again and
wait for a CLOSE interprocess message, which indicates that the Dispatcher has
closed the TP.