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
);
{
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");
}
}
None.