Back to home page

Enduro/X

 
 

    


0001 TPSEND(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpsend - Send message to open conversation
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int tpsend(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 Send a message to open conversation, described by 'cd', which is opened by *tpconnect()*. 
0025 The outgoing buffer 'data' must be allocated with *tpalloc()*, if buffer is not 
0026 self describing .e.g *CARRAY*, then 'len' parameter must be correctly set. 
0027 The 'data' can be also set to NULL in that case 'len' is not used.
0028 
0029 Enduro/X does not terminate global transaction in case of send failure.
0030 
0031 *Valid flags*
0032 
0033 *TPRECVONLY* Signal the caller that we want to enter in listening mode. 
0034 The other end will receive *TPEV_SENDONLY* event.
0035 
0036 *TPNOBLOCK* Do not block the call if conversational queue is full.
0037 
0038 *TPSIGRSTRT* Restart the system call in progress if interrupted by signal handler. 
0039 This affects only underlying mq_* function calls.
0040 
0041 *TPNOBLOCK* Do not block on empty queue, if not messages present, the 
0042 function returns immediately.
0043 
0044 *TPNOTIME* In case if blocking condition exists (queue full), wait indefinitely 
0045 on queue to send msg.
0046 
0047 RETURN VALUE
0048 ------------
0049 On success, *tpsend()* return zero; on error, -1 is returned, with *tperrno* 
0050 set to indicate the error.
0051 
0052 *'revent' return values:*
0053 
0054 *TPEV_DISCONIMM* Disconnect received from other conversation end, 
0055 by issuing *tpdiscon()*. The global transaction in progress is aborted in this case.
0056 Connection descriptor 'cd' is closed.
0057 
0058 *TPEV_SVCERR* Server died or *tpreturn(3)* failed. Connection descriptor 'cd' is closed.
0059 
0060 *TPEV_SVCFAIL* Server returned *TPFAIL* with *tpreturn(3)* Connection descriptor 'cd' is closed.
0061 
0062 *TPEV_SVCSUCC* Server did *tpreturn()* with *TPSUCCESS*, connection is closed
0063 automatically after this event. Connection descriptor 'cd' is closed.
0064 
0065 ERRORS
0066 ------
0067 Note that *tpstrerror()* returns generic error message plus custom message 
0068 with debug info from last function call.
0069 
0070 *TPEINVAL* Invalid call descriptor 'cd' passed in or 'data' pointer is 
0071 not pointing to buffer allocated by *tpalloc()*.
0072 
0073 *TPETIME* Was unable to send message in given time('NDRX_TOUT' env param.). 
0074 
0075 *TPEEVENT* Event received and it is installed into 'revent' field.
0076 
0077 *TPESYSTEM* System failure occurred during serving. See logs i.e. user log, 
0078 or debugs for more info.
0079 
0080 *TPEOS* System failure occurred during serving. See logs i.e. user log,
0081  or debugs for more info.
0082 
0083 *TPEPROTO* Protocol error is generated if given process is in receiver (*TPRECVONLY*)
0084 mode.
0085 
0086 EXAMPLE
0087 -------
0088 See *atmitest/test003_basicconvers/atmisv3.c* for sample code.
0089 
0090 BUGS
0091 ----
0092 Report bugs to support@mavimax.com
0093 
0094 SEE ALSO
0095 --------
0096 *tpconnect(3)* *tprecv(3)* *tpdiscon(3)* *tpreturn(3)*
0097 
0098 COPYING
0099 -------
0100 (C) Mavimax, Ltd
0101