e-docs > Tuxedo > ATMI C Function Reference > Section 3c - C Functions |
ATMI C Function Reference |
Name
tpacall()—Routine for sending a service request.
Synopsis
#include <atmi.h>
int tpacall(char *svc, char *data, long len, long flags)
Description
tpacall() sends a request message to the service named by svc. The request is sent out at the priority defined for svc unless overridden by a previous call to tpspri(). If data is non-NULL, it must point to a buffer previously allocated by tpalloc() and len should specify the amount of data in the buffer that should be sent. Note that if data points to a buffer of a type that does not require a length to be specified, (for example, an FML fielded buffer), then len is ignored (and may be 0). If data is NULL, len is ignored and a request is sent with no data portion. The type and subtype of data must match one of the types and subtypes recognized by svc. Note that for each request sent while in transaction mode, a corresponding reply must ultimately be received.
The following is a list of valid flags:
In a multithreaded application, a thread in the TPINVALIDCONTEXT state is not allowed to issue a call to tpacall().
Return Values
Upon successful completion, tpacall() returns a descriptor that can be used to receive the reply of the request sent.
Upon failure, tpacall() returns a value of -1 and sets tperrno to indicate the error condition.
Errors
Upon failure, tpacall() sets tperrno to one of the following values. (Unless otherwise noted, failure does not affect the caller's transaction, if one exists.)
See Also
tpalloc(3c), tpcall(3c), tpcancel(3c), tpgetrply(3c), tpgprio(3c), tpsprio(3c)