The aftp_set_destination call specifies the destination of the AFTP server. This call must be issued before establishing a connection to the AFTP server. After a connection is established, the destination cannot be changed.
AFTP_ENTRY aftp_set_destination(
IN AFTP_HANDLE_TYPE connection_id,
IN unsigned char AFTP_PTR destination,
IN AFTP_LENGTH_TYPE length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR return_code
);
See the APPC Application Suite User's Guide for information about specifying destinations in the APPC Application Suite.
{
AFTP_HANDLE_TYPE connection_id;
static unsigned char AFTP_PTR destination = "NETWORK.SERVER";
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 partner we want to communicate with - who will
* be running the AFTP server.
*/
aftp_set_destination(
connection_id,
destination,
(AFTP_LENGTH_TYPE)strlen(destination),
&aftp_rc);
if (aftp_rc != AFTP_RC_OK) {
fprintf(stderr, "Error setting AFTP destination.\n");
}
}
None.