Back to home page

Enduro/X

 
 

    


0001 TPPOST(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tppost - Post event
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int tppost (char *'eventname', 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 Post event to event broker. This function will call the event server's *@TPEVPOST* 
0025 service. Which will broadcast the 'eventname' event and 'data', 'len' buffer 
0026 to servers subscribed to even, if event mask and filter matches the event name 
0027 and buffer passed to. 'data' can be NULL buffer. If not NULL, then it must be 
0028 allocated by *tpalloc()*, the 'len' is mandatory for types which does not 
0029 contain self described length. The event brokers will broadcast event also 
0030 to connected bridges. On return function returns number of servers consumed 
0031 the event. This includes also number of servers consumed events on remote hosts.
0032 
0033 *Valid flags*
0034 
0035 *TPNOTRAN* Do not call service in transaction mode. This is effective in case 
0036 if caller process is running in transaction mode, but destination process 
0037 shall not run in the same global transaction. This flag is inherited during the
0038 server postings.
0039 
0040 *TPNOREPLY* Do not wait for reply from event server. In this case number of 
0041 applied events will be 0.
0042 
0043 *TPSIGRSTRT* Restart the system call in progress if interrupted by signal handler. 
0044 This affects only underlaying mq_* function calls. This flag is inherited during the
0045 server postings.
0046 
0047 *TPNOTIME* Ignore timeout setting (*NDRX_TOUT* env variable). 
0048 Wait for reply for infinitely.  This flag is inherited during the
0049 server postings.
0050 
0051 *TPNOBLOCK* In case of queue to event server is full, do not wait on 
0052 queue, but return error. In the same way this flag is inherited in *tpevsrv(8)*
0053 during the event posting to local servers and remote bridges. Thus if blocking
0054 condition did exist during the postings, those postings will be skipped and
0055 and thus that will reflect in return value of this function.
0056 
0057 RETURN VALUE
0058 ------------
0059 On success, *tppost()* returns number of servers consumed the event. The 
0060 *tpurcode* have the same value. On error, -1 is returned, with *tperrno* 
0061 set to indicate the error.
0062 
0063 ERRORS
0064 ------
0065 Note that *tpstrerror()* returns generic error message plus custom message 
0066 with debug info from last function call.
0067 
0068 *TPEINVAL* Invalid parameter is given to function. Event name is *NULL* or empty.
0069 
0070 *TPENOENT* Event server is not available.
0071 
0072 *TPETIME* Service did not reply in given time (*NDRX_TOUT*).
0073 
0074 *TPESVCFAIL* Service returned *TPFAIL*. This is application level failure.
0075 
0076 *TPESVCERR* System level service failure. Server died during the 
0077 message presence in service queue.
0078 
0079 *TPESYSTEM* System failure occurred during serving. See logs i.e. 
0080 user log, or debugs for more info.
0081 
0082 *TPEOS* System failure occurred during serving. See logs i.e. user 
0083 log, or debugs for more info.
0084 
0085 EXAMPLE
0086 -------
0087 See *atmitest/test004_basicevent/atmiclt4.c* for sample code.
0088 
0089 BUGS
0090 ----
0091 Report bugs to support@mavimax.com
0092 
0093 SEE ALSO
0094 --------
0095 *tpevsrv(8)* *tpsubscribe(3)* *tppost(3)*
0096 
0097 COPYING
0098 -------
0099 (C) Mavimax, Ltd
0100