Back to home page

Enduro/X

 
 

    


0001 TPRECV(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tprecv - Receive message from open conversation
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int tprecv(int 'cd', char **'data', long *'len', long 'flags', long *'revent');
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 Receive message from open conversation, which is opened by *tpconnect()*. 
0025 The incoming  buffer 'data' must be allocated with *tpalloc()*. If conversation 
0026 receives disconnect (*TPEV_DISCONIMM*), service error (*TPEV_SVCERR*) or 
0027 service failure (*TPEV_SVCFAIL*), then global transaction if one in progress is aborted.
0028 'data' and 'len' are mandatory arguments which are used for receiving the XATMI
0029 buffer.
0030 
0031 *Valid flags*
0032 
0033 *TPSIGRSTRT* Restart the system call in progress if interrupted by signal 
0034 handler. This affects only underlying mq_* function calls.
0035 
0036 *TPNOTIME* Ignore timeout setting (*NDRX_TOUT* env variable). 
0037 Wait for reply for infinitely.
0038 
0039 *TPNOBLOCK* Do not block on empty queue, if not messages present, 
0040 the function returns immediately.
0041 
0042 RETURN VALUE
0043 ------------
0044 On success, *tprecv()* return zero; on error, -1 is returned, 
0045 with *tperrno* set to indicate the error. In case of event received, the
0046 error code is set to *TPEEVENT*.
0047 
0048 *'revent' return values:*
0049 
0050 *TPEV_DISCONIMM* Disconnect received from other conversation end, 
0051 by issuing *tpdiscon()*. The global transaction in progress is aborted in this case.
0052 Connection descriptor 'cd' is closed.
0053 
0054 *TPEV_SENDONLY* The sender program issued *tpsend()* with 
0055 flag *TPEV_SENDONLY*, meaning that we become senders.
0056 
0057 *TPEV_SVCERR* Server died or *tpreturn(3)* failed. Connection descriptor 'cd' is closed.
0058 
0059 *TPEV_SVCFAIL* Server returned *TPFAIL* with *tpreturn()* Connection descriptor 'cd' is closed.
0060 
0061 *TPEV_SVCSUCC* Server did *tpreturn()* with *TPSUCCESS*, connection is closed
0062 automatically after this event. Connection descriptor 'cd' is closed.
0063 
0064 ERRORS
0065 ------
0066 Note that *tpstrerror()* returns generic error message plus 
0067 custom message with debug info from last function call.
0068 
0069 *TPEBLOCK* *TPENOBLOCK* was specified in flags and no message is in queue.
0070 
0071 *TPEINVAL* Invalid call descriptor 'cd' passed in. 'data' or 'len' is NULL.
0072 
0073 *TPETIME* Service did not reply in given time ('NDRX_TOUT'). 
0074 
0075 *TPEEVENT* Event received and it is installed into 'revent' field.
0076 
0077 *TPEPROTO* System level service failure. Server died during the message 
0078 presence in service queue.
0079 
0080 *TPESYSTEM* System failure occurred during serving. See logs i.e. user log, 
0081 or debugs for more info.
0082 
0083 *TPEOS* System failure occurred during serving. See logs i.e. user log, 
0084 or debugs for more info.
0085 
0086 *TPEPROTO* Protocol error is generated if given process is in sender mode.
0087 
0088 EXAMPLE
0089 -------
0090 See *atmitest/test003_basicconvers/atmisv3.c* for sample code.
0091 
0092 
0093 BUGS
0094 ----
0095 Report bugs to support@mavimax.com
0096 
0097 SEE ALSO
0098 --------
0099 *tpconnect(3)* *tpsend(3)* *tpdiscon(3)*
0100 
0101 COPYING
0102 -------
0103 (C) Mavimax, Ltd
0104