Skip navigation.

ATMI C Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


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]

This error code indicates that either a timeout has occurred or tpdiscon() has been attempted, in spite of the fact that the current transaction is already marked rollback only.

If the caller is in transaction mode, then either the transaction is already rollback only or a transaction timeout has occurred. The transaction is marked abort-only. (Note that calling tpdiscon() on a connection in the caller's transaction would have resulted in the transaction being marked abort-only, even if tpdiscon() had succeeded.)

If the caller is not in transaction mode, a blocking timeout has occurred.

If a transaction timeout has occurred, then, with one exception, any attempts to perform further conversational work, send new requests, or receive outstanding replies will fail with TPETIME until the transaction has been aborted. The exception is a request that does not block, expects no reply, and is not sent on behalf of the caller's transaction (that is, tpacall() with TPNOTRAN, TPNOBLOCK, and TPNOREPLY set).

When a service fails inside a transaction, the transaction is put into the TX_ROLLBACK_ONLY state. This state is treated, for most purposes, as though it were equivalent to a timeout. All further ATMI calls for this transaction (with the exception of those issued in the circumstances described in the previous paragraph) will fail with TPETIME.

[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)

 

Skip navigation bar  Back to Top Previous Next