lrt_tpcall

Communication Functions

Sends a service request and awaits its reply.

int lrt_tpcall( char *svc, char *idata, long ilen, char **odata, long *olen, long flags );

svc Requested service (can be parameterized).
idata Data portion of the request.
ilen Length of request data to send.
odata Reply data.
olen Length of reply data.
flags Valid flags: TPNOTRAN- SVC will not be performed on behalf of caller's transaction, TPNOCHANGE - buffer type of reply data is not allowed to change, TPNOBLOCK - request not sent if blocking condition exists, TPNOTIME - caller immune to blocking timeouts, TPSIGRSTRT - any interrupted system calls are re-issued afterlrt_tpcall.

The lrt_tpcall function sends a service request and awaits its reply.

Return Values

If the function succeeds, it returns a reply to the service request. If the function ends with an error, it returns -1 and sets the error code in tperrno.

Parameterization

The following argument(s) can be parameterized using standard parameterization: svc

Example

In the following example, the lrt_tpcall statement sends a withdrawal request with the data in the data_0 buffer.

Copy code
/* Request a withdrawal of $15 from account #102*/
lrt_Finitialize((FBFR*)data_0);
lrt_Fadd_fld((FBFR*)data_0, "name=ACCOUNT_ID", "value=102", LRT_END_OF_PARMS);
lrt_Fadd_fld((FBFR*)data_0, "name=SAMOUNT", "value=15.00", LRT_END_OF_PARMS);
tpresult_int = lrt_tpcall("WITHDRAWAL", data_0, 0, &data_0, &olen_2, 0);
lrt_abort_on_error();
lrt_tpcommit(0);