BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

tpdiscon(3c)

Name

tpdiscon() - routine for taking down a conversational service connection

Synopsis

#include <atmi.h>
int tpdiscon(int cd)

Description

tpdiscon() immediately tears down the connection specified by cd and generates a TPEV_DISCONIMM event on the other end of the connection.

tpdiscon() can be called only by the initiator of the conversation. tpdiscon() cannot be called within a conversational service on the descriptor with which it was invoked. Rather, a conversational service must use tpreturn() to signify that it has completed its part of the conversation. Similarly, even though a program communicating with a conversational service can issue tpdiscon(), the preferred way is to let the service tear down the connection in tpreturn(); doing so ensures correct results.

tpdiscon() causes the connection to be torn down immediately (that is, abortive rather than orderly). Any data that has not yet reached its destination may be lost. tpdiscon() can be issued even when the program on the other end of the connection is participating in the caller's transaction. In this case, the transaction must be aborted. Also, the caller does not need to have control of the connection when tpdiscon() is called.

Return Values

Upon failure, tpdiscon() returns -1 and sets tperrno() to indicate the error condition.

Errors

Upon failure, tpdiscon() sets tperrno() to one of the following values.

[TPEBADDESC]

cd is invalid or is the descriptor with which a conversational service was invoked.

[TPETIME]

A timeout occurred. The descriptor is no longer valid.

[TPEPROTO]

tpdiscon() was called improperly.

[TPESYSTEM]

A BEA Tuxedo system error has occurred. The exact nature of the error is written to a log file. The descriptor is no longer valid.

[TPEOS]

An operating system error has occurred. The descriptor is no longer valid.

See Also

tpabort(3c), tpcommit(3c), tpconnect(3c), tprecv(3c), tpreturn(3c), tpsend(3c)