User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.0.x:api:xatmi:tppost.3

TPPOST

TPPOST

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
EXAMPLE
BUGS
SEE ALSO
COPYING

NAME

tppost − Post event

SYNOPSIS

#include <atmi.h>

int tppost (char *eventname, char *data, long len, long flags);

For XATMI client link with −latmiclt −latmi −lubf −lnstd −lpthread −lrt −lm

For XATMI server link with −latmisrv|−latmisrvnomain|−latmisrvinteg −latmi −lubf −lnstd −lpthread −lrt −lm

DESCRIPTION

Post event to event broker. This function will call the event server’s @TPEVPOST service. Which will broadcast the eventname event and data, len buffer to servers subscribed to even, if event mask and filter matches the event name and buffer passed to. data can be NULL buffer. If not NULL, then it must be allocated by tpalloc(), the len is mandatory for types which does not contain self described length. The event brokers will broadcast event also to connected bridges. On return function returns number of servers consumed the event. This includes also number of servers consumed events on remote hosts.

Valid flags

TPNOTRAN Do not call service in transaction mode. This is effective in case if caller process is running in transaction mode, but destination process shall not run in the same global transaction. This flag is inherited during the server postings.

TPNOREPLY Do not wait for reply from event server. In this case number of applied events will be 0.

TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlaying mq_* function calls. This flag is inherited during the server postings.

TPNOTIME Ignore timeout setting (NDRX_TOUT env variable). Wait for reply for infinitely. This flag is inherited during the server postings.

TPNOBLOCK In case of queue to event server is full, do not wait on queue, but return error. In the same way this flag is inherited in tpevsrv(8) during the event posting to local servers and remote bridges. Thus if blocking condition did exist during the postings, those postings will be skipped and and thus that will reflect in return value of this function.

RETURN VALUE

On success, tppost() returns number of servers consumed the event. The tpurcode have the same value. On error, −1 is returned, with tperrno set to indicate the error.

ERRORS

Note that tpstrerror() returns generic error message plus custom message with debug info from last function call.

TPEINVAL Invalid parameter is given to function. Event name is NULL or empty.

TPENOENT Event server is not available.

TPETIME Service did not reply in given time (NDRX_TOUT).

TPESVCFAIL Service returned TPFAIL. This is application level failure.

TPESVCERR System level service failure. Server died during the message presence in service queue.

TPESYSTEM System failure occurred during serving. See logs i.e. user log, or debugs for more info.

TPEOS System failure occurred during serving. See logs i.e. user log, or debugs for more info.

EXAMPLE

See atmitest/test004_basicevent/atmiclt4.c for sample code.

BUGS

Report bugs to support@mavimax.com

SEE ALSO

tpevsrv(8) tpunsubscribe(3) tppost(3)

COPYING

© Mavimax, Ltd