aftp_set_tp_name

The aftp_set_tp_name call specifies the transaction program (TP) name of the AFTP server. This call can only be invoked prior to the establishment of a connection to the AFTP server. When a connection is open, the TP name cannot be changed. The AFTP API defaults the TP name on the server to be AFTPD. This call is not necessary unless you want to experiment with a server that might not have the same behavior as AFTPD.

AFTP_ENTRY aftp_set_tp_name(
IN AFTP_HANDLE_TYPE
connection_id,
IN unsigned char AFTP_PTR
tp_name,
IN AFTP_LENGTH_TYPE
length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
tp_name
The TP name of the AFTP server. The TP name can be from 1 through 64 bytes long. The default TP name is AFTPD.
length
The length of the tp_name parameter in bytes.
return_code
The return code issued for this function. See AFTP Return Codes for the list of possible return codes.

Example

{
    AFTP_HANDLE_TYPE              connection_id;
    static unsigned char AFTP_PTR tp_name = "AFTPME";
    AFTP_RETURN_CODE_TYPE         aftp_rc;

    /*
     * Before issuing the example call, you must have:
     *    a connection_id, use:  aftp_create()
     *
     * You cannot have an open connection.
     */

    /*
     * Set the TP name for the AFTP server.
     */

    aftp_set_tp_name(
        connection_id,
        tp_name,
        (AFTP_LENGTH_TYPE)strlen(tp_name),
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error setting AFTP TP name.\n");
    }
}
 

Line Flows

None.