aftp_set_destination

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
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
destination
Identifies the location of the AFTP server. This parameter can be either a symbolic destination name or a partner LU name.

See the APPC Application Suite User's Guide for information about specifying destinations in the APPC Application Suite.

length
The length of the destination 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 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");
    }
}
 

Line Flows

None.