0001 TPGETRPLY(3)
0002 ============
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 tpgetrply - Get reply from asynchronous service call
0009
0010
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014
0015 int tpgetrply(int \*'cd', char **'data', long *'len', long 'flags');
0016
0017
0018 For XATMI client link with '-latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm'
0019
0020 For XATMI server link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0021
0022 DESCRIPTION
0023 -----------
0024 Get the response from asynchronous service call. The 'cd' is pointer to call
0025 descriptor to which value might be set, in that case only matched reply is
0026 returned, other messages are dropped. 'data' and 'len' are field used for
0027 storing the reply messages. Fields must be allocated by *tpalloc()*.
0028 In case if *TPGETANY* flag is used, then any first response which is
0029 received is returned to user application. In case of error, global transaction
0030 is marked for abort (if associated with current thread), except if *TPNOABORT* flag was
0031 specified or particular error code indicates that global transaction is not aborted.
0032
0033 *Valid flags*
0034
0035 *TPGETANY* Return first response message received. The connection identifier is
0036 stored into 'cd'.
0037
0038 *TPNOBLOCK* Do not block for waiting on response message. Instead function
0039 returns with 'cd' equals to 0. And function return result is SUCCEED (0).
0040
0041 *TPSIGRSTRT* Restart the system call in progress if interrupted by signal handler.
0042 This affects only underlaying mq_* function calls.
0043
0044 *TPNOTIME* Ignore timeout setting (*NDRX_TOUT* env variable).
0045 Wait for reply for indefinitely.
0046
0047 *TPNOCHANGE* Do not allow to change the reply buffer type. If flag is set and
0048 different buffer type is received than original, then error *TPEINVAL* is returned.
0049
0050 *TPNOABORT* Do not abort global transaction (if one in progress), even if service
0051 failed.
0052
0053 If case if reply was requested for particular 'cd' and timeout was received
0054 (*TPETIME*), function does not cancel the 'cd'. Thus if server process
0055 the request slower than timeout value, still it is possible to receive the
0056 response data with several tpgetrply() attempts on particular 'cd'.
0057
0058 RETURN VALUE
0059 ------------
0060 On success, *tpgetrply()* returns 0; on error, -1 is returned, with
0061 *tperrno* set to indicate the error.
0062
0063
0064 ERRORS
0065 ------
0066 Note that *tpstrerror()* for last calls returns generic error message plus
0067 custom message with debug info from last call.
0068
0069 *TPEBLOCK* *TPENOBLOCK* was specified in flags and no message is in queue.
0070 Global transaction is not marked for abort only, if one was associated
0071 with current thread.
0072
0073 *TPEINVAL* Invalid parameter is given to function. Particularly pointer
0074 parameters are NULL. Global transaction is not marked for abort only,
0075 if one was associated with current thread.
0076
0077 *TPEBADDESC* 'cd' parameter points to not issued or canceled call descriptor
0078 and *TPGETANY* flag was not specified. Global transaction is not marked for
0079 abort only, if one was associated with current thread.
0080
0081 *TPETIME* Service did not reply in given time ('NDRX_TOUT' time).
0082
0083 *TPESVCFAIL* Service returned 'TPFAIL'. This is application level failure.
0084
0085 *TPESVCERR* System level service failure. Server died during the message presence
0086 in service queue. Or internals of *tpreturn(3)* failed at server code, e.g.
0087 failed to commit auto-tran.
0088
0089 *TPESYSTEM* System failure occurred during serving. See logs i.e. user log, or
0090 debugs for more info.
0091
0092 *TPEOS* System failure occurred during serving. See logs i.e. user log, or
0093 debugs for more info.
0094
0095 *TPETRAN* Called service is configured as auto-tran, but internal *tpbegin(3)*
0096 at XATMI server code failed. Or server failed to join global transaction. See
0097 reasons in log file.
0098
0099 *TPEITYPE* There was problem with XATMI data type buffer, not supported by service
0100 or corrupted. Global transaction is not marked for abort only,
0101 if one was associated with current thread.
0102
0103 EXAMPLE
0104 -------
0105 See *atmitest/test018_tpacalltout/atmiclt18.c* for sample code.
0106
0107 BUGS
0108 ----
0109 Report bugs to support@mavimax.com
0110
0111 SEE ALSO
0112 --------
0113 *tpcall(3)* *tpacall(3)*
0114
0115 COPYING
0116 -------
0117 (C) Mavimax, Ltd
0118