Tuxedo 6.5.3 tuxpostio
process should simply reinvoke the waiting function in this case. If the application uses dip-in based message
notification, the process should invoke AWAITIOX() or FILE_COMPLETE_() with a small timeout (a few seconds)
and check for unsolicited messages whenever the function returns the FETIMEDOUT error. The process can check for
unsolicited messages by calling the tpchkunsol() NonStop TUXEDO ATMI function.
Certain NonStop TUXEDO functions always wait until their operations complete. Completions for these operations can
never be received via AWAITIOX() or FILE_COMPLETE_(), and calling these functions in multi-threaded processes
may degrade the process' performance. The blocking functions include tpcall(), tpenqueue(), tppost() without the
TPNOREPLY flag, and tpnotify() with the TPACK flag.
Examples
The first example uses AWAITIOX() to wait for a completion on any Guardian file or Guardian socket.
error = 0;
file = -1
while (_status_ne(AWAITIOX (&file, &bufptr, &xfrlen, &iotag, -1)) {
(void) FILE_GETINFO_(file, &error);
if (error == EINTR) continue; /* OSS signal handler invoked */
if (file != -1) break;
process error in AWAITIOX() call and exit
}
if (tuxpostio(0, file, error, iotag, xfrlen) != 0)
{
if (tpgetrply(&cd, &rcvbuf, &buflen, TPGETANY|TPNOBLOCK) != -1)
{
/* process tpacall() request successful completion */
} else
if (tperrno == TPEBLOCK || tperrno == TPEPROTO) {
/* no tpacall() request completed; go wait again */
} else {
/* process tpacall() request failure completion */
}
} else {
/* process i/o operation initiated outside of NonStop Tuxedo */
}
The second example uses FILE_COMPLETE_() to wait for a completion on a list of Guardian or OSS files or sockets
previously specified by calling FILE_COMPLETE_SET_().
while (error = FILE_COMPLETE_(&compinfo, -1)) != 0)
{
if (error == EINTR) continue; /* OSS signal handler invoked */
/* process error in FILE_COMPLETE_() call and exit */
}
if (tuxpostio(compinfo.z_filetype, compinfo.z_fnum_fd,
compinfo.z_error, compinfo.z_tag,
compinfo.z_count_transferred) != 0)
{
if (tpgetrply(&cd, &rcvbuf, &buflen, TPGETANY|TPNOBLOCK) != -1)
{
/* process tpacall() request successful completion */
tuxpostio
file:///C|/READMEs TUXEDO/Release 6.5 V3 white/NSTux65v3tuxpostio.htm (2 of 3) [7/6/2004 9:37:37 AM]