Implementing asynchronous output support
You implement asynchronous output support by enabling the receipt of the asynchronous output.
The end user of the client application can decide when to request the asynchronous output, or the client application itself can decide when to request the asynchronous output.
Recommendation: Implement
asynchronous output support so that the end user, not the client
application, decides when to request the asynchronous output. Such
an implementation provides these benefits:
- Ensures that the transaction input and output is separated from the asynchronous output.
- Enables the end user to select, at a time interval of their choice, when to retrieve the asynchronous output.
Regardless of whether or not the end user or the client application requests the asynchronous output, the following actions must occur, in this order:
Procedure
- Issue a CONNECT command.
- A TCP/IP SEND of an OTMA RESUME TPIPE call, immediately followed by a TCP/IP READ function from the primary client application.
- A TCP/IP SEND of an ACK or NAK response on the receipt of the output message. If the ACK was sent with a timer value of NOWAIT (NOWAIT is only valid for a RESUME TPIPE call with SINGLE or SINGLE with WAIT option), go to step 5. If NAK was sent, go to step 5.
- A TCP/IP READ function from the primary client application. Repeat steps 2 and 3 until either all messages have been received, until the end user has received all of the messages that they want, until an error occurs, or until time out notification occurs.
- Issue a DISCONNECT command, if you are using transaction sockets. If you are using persistent sockets, the connection is still connected.