lrt_tpcancel
| Communication Functions |
Cancels a call descriptor.
int lrt_tpcancel( int cd );
| cd | Call descriptor to cancel. |
The lrt_tpcancel function cancels a call descriptor. After lrt_tpcancel, the call descriptor cd is no longer valid, and any reply to cd will be disregarded. Any attempt to cancel a call descriptor associated with a transaction will result in an error.
Return Values
If the function ends with an error, it returns -1 and sets the error code in tperrno.
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
In the following example, the lrt_tpcancel function cancelled the request to perform the TOUPPER service.
vuser_init()
{
char* data_0;
char* data_1;
long buflen;
int cd;
char string[] = "This is a string.";
data_0 = lrt_tpalloc("STRING", "", sizeof(string));
// Send a request, but cancel it afterwards
lrt_strcpy(data_0, string);
cd = lrt_tpacall("TOUPPER", data_0, 0, 0);
lrt_tpcancel(cd);
// Send a request, and look at reply
data_1 = lrt_tpalloc("STRING", "", 1024);
lrt_tpgetrply(&cd, &data_1, &olen, 0);
buflen = lrt_tptypes(data_1, type, NULL);
lr_output_message("The reply buffer type is %s, size is %lu.", type, buflen);
return 0;

