Previous Page Contents Page Next Page

3.2 TP_ENDED

The TP_ENDED verb is issued by both the invoking and the invoked TPs. It notifies APPC that the TP is ending. In response to this verb, APPC frees the resources used by the TP.

If an APPC conversation is still in progress, TP_ENDED performs the function of the [MC_]DEALLOCATE verb with dealloc_type set to AP_ABEND (for a mapped conversation) or AP_ABEND_PROG (for a basic conversation). After this verb executes, the TP identifier and conversation identifier are no longer valid; the TP cannot issue any more APPC verbs for the conversation.

3.2.1 VCB Structure: TP_ENDED

The definition of the VCB structure for the TP_ENDED verb is as follows:

typedef struct tp_ended
{
  AP_UINT16         opcode;
  unsigned char     opext;                 /* Reserved      */
  unsigned char     format;                /* Reserved      */
  AP_UINT16         primary_rc;
  AP_UINT32         secondary_rc;
  unsigned char     tp_id[8];
  unsigned char     type;
} TP_ENDED; 

3.2.2 VCB Structure: TP_ENDED (Windows)

The definition of the VCB structure for the TP_ENDED verb is as follows:

typedef struct tp_ended
{
  unsigned short    opcode;
  unsigned char     opext;
  unsigned char     reserv2;
  unsigned short    primary_rc;
  unsigned long     secondary_rc;
  unsigned char     tp_id[8];
  unsigned char     type;
} TP_ENDED;

3.2.3 Supplied Parameters

The TP supplies the following parameters to APPC:

opcode

AP_TP_ENDED

tp_id

Identifier for the local TP.

The value of this parameter was returned by the TP_STARTED verb for the invoking TP or by the RECEIVE_ALLOCATE verb for the invoked TP.

type

Specifies how to end the TP. Possible values are:

AP_SOFT

If any APPC conversations are active, APPC performs the function of the [MC_]DEALLOCATE verb for each conversation, in order to inform the partner TP that the conversation has ended. The TP_ENDED verb does not return until [MC_]DEALLOCATE has completed.

AP_HARD

APPC closes all sessions used by the TP, and TP_ENDED returns immediately.

3.2.4 Returned Parameters

After the verb executes, APPC returns parameters to indicate whether the execution was successful and, if not, to indicate the reason the execution was not successful.

Successful Execution

If the verb executes successfully, APPC returns the following parameter:

primary_rc

AP_OK

APPC does not return a secondary_rc when the verb executes successfully.

Unsuccessful Execution

If the verb does not execute successfully, APPC returns a primary return code parameter to indicate the type of error and a secondary return code parameter to provide specific details about the reason for unsuccessful execution.

Parameter Check

If the verb does not execute because of a parameter error, APPC returns the following parameters:

primary_rc

AP_PARAMETER_CHECK

secondary_rc

Possible values are:

AP_BAD_TP_ID

APPC did not recognize the tp_id as an assigned TP identifier.

AP_BAD_TYPE

The value of the type parameter was not valid.

AP_INVALID_FORMAT

The reserved parameter format was set to a nonzero value.

AP_SYNC_NOT_ALLOWED

The application issued this verb within a callback routine, using the synchronous APPC entry point. Any verb issued from a callback routine must use the asynchronous entry point.

State Check

No state check errors occur for this verb.

Other Conditions

If the verb does not execute because other conditions exist, APPC returns primary return codes (and, if applicable, secondary return codes). For information about these return codes, see Common Return Codes.

Possible return codes are:

primary_rc

AP_COMM_SUBSYSTEM_ABENDED
AP_COMM_SUBSYSTEM_NOT_LOADED
AP_INVALID_VERB
AP_TP_BUSY
AP_UNEXPECTED_SYSTEM_ERROR

AP_STACK_TOO_SMALL
AP_INVALID_VERB_SEGMENT

APPC does not return secondary return codes with these primary return codes.

3.2.5 State When Issued

The conversation (or conversations, if the TP is involved in more than one) can be in any state when the TP issues this verb.

3.2.6 State Change

After successful execution (primary_rc is AP_OK), there is no APPC state.

Previous Page Contents Page Top of Page Next page