lrt_tpdiscon

Communication Functions

Takes down a conversational service connection.

int lrt_tpdiscon( int cd );

cd Call descriptor to disconnect.

The lrt_tpdiscon function disconnects a conversational service connection. This function can only be called by the initiator of the conversation. Once this function is called, you can no longer send or receive on that connection.

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_tpdiscon function disconnects a conversational open connection, cd.

Copy code
char* data_0;
char* data_1;
int cd;
lrt_tpconnect("AUDITC", NULL, 0, TPSENDONLY);
data_0 = lrt_tpalloc("STRING", "", 80);
lrt_strcpy(data_0, "t"); // get teller balances for bank app
data_1 = lrt_tpalloc("STRING", "", 1024);
lrt_tpsend(cd,data_0,0,TPRECVONLY,&revent);
lrt_tprecv(cd,&data_1,&olen,TPNOCHANGE,&revent);
lrt_strcpy(data_0, "a"); // get account balances for bank app
lrt_tpsend(cd,data_0,0,TPRECVONLY,&revent);
lrt_tprecv(cd,&data_1,&olen,TPNOCHANGE,&revent);
lrt_tpdiscon(cd);                                    
// take down conversational client connection
// can't call lrt_tpsend or lrt_tprecv on this connection any more.