tpsend

Name

tpsend — Send message to open conversation

Synopsis

#include <atmi.h>

int tpsend(int cd, char *data, long len, long flags, long *revent);

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

Send a message to open conversation, described by cd, which is opened by tpconnect(). The outgoing buffer data must be allocated with tpalloc(), if buffer is not self describing .e.g CARRAY, then len parameter must be correctly set. The data can be also set to NULL in that case len is not used.

Enduro/X does not terminate global transaction in case of send failure.

Valid flags

TPRECVONLY Signal the caller that we want to enter in listening mode. The other end will receive TPEV_SENDONLY event.

TPNOBLOCK Do not block the call if conversational queue is full.

TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlying mq_* function calls.

TPNOBLOCK Do not block on empty queue, if not messages present, the function returns immediately.

TPNOTIME In case if blocking condition exists (queue full), wait indefinitely on queue to send msg.

RETURN VALUE

On success, tpcall() return zero; on error, -1 is returned, with tperrno set to indicate the error.

revent return values:

TPEV_DISCONIMM Disconnect received from other conversation end, by issuing tpdiscon(). The global transaction in progress is aborted in this case. Connection descriptor cd is closed.

TPEV_SENDONLY The sender program issued tpsend() with flag TPEV_SENDONLY, meaning that we become senders.

TPEV_SVCERR Server died or tpreturn(3) failed. Connection descriptor