OpenTP1 Version 7 Programming Reference COBOL Language

[Contents][Index][Back][Next]

TPDISCON - Terminate a conversational service connection abortively

Format

01  TPSVCDEF-REC.
    COPY  TPSVCDEF.
01  TPSTATUS-REC.
    COPY  TPSTATUS.
 
CALL "TPDISCON" USING TPSVCDEF-REC  TPSTATUS-REC.

Description

TPDISCON immediately terminates the connection specified by COMM-HANDLE and generates a TPEV-DISCONIMM event on the other end of the connection.

TPDISCON can be called only by the originator of the conversation. TPDISCON cannot be called within a conversational service on the communication handle 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 terminate the connection in TPRETURN; doing so ensures correct results.

TPDISCON causes the connection to be terminated immediately (that is, abortively 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 rolled back. Also, the caller does not need to have control of the connection when TPDISCON is called.

<<Data areas>>

<<TPSVCDEF-REC

Specify the communication handle of the connection indicated by COMM-HANDLE to be aborted.>>

<<TPSTATUS-REC

Will be assigned the return value indicating the result of TPDISCON execution.>>

Return value

Upon successful completion, TPDISCON sets TP-STATUS to TPOK.

Errors

Under the following conditions, TPDISCON fails and sets TP-STATUS to one of the following values:

TPEBADDESC
Either COMM-HANDLE is invalid or it is the communication handle with which a conversational service was invoked.

TPETIME
A timeout occurred. The communication handle is no longer valid.

TPEPROTO
TPDISCON was called in an improper context.

TPESYSTEM
A communication resource manager system error has occurred. The exact nature of the error is determined in a product-specific manner.

TPEOS
An operating system error has occurred. The exact nature of the error is determined in a product-specific manner.

See also

TPCONNECT, TPRECV, TPRETURN, TPSEND.

<<Notes on use with OpenTP1>>

  1. <<The error code TPETIME will not be returned to TP-STATUS under the relevant version of the OpenTP1.>>
  2. <<When OSI TP communication using the TP1/NET/OSI-TP-Extended is in progress, it cannot be used for conversational services. If an attempt is made to do so, the system operation is unpredictable.>>