aftp_connect

The aftp_connect call establishes a connection to the AFTP server. You must identify the destination of the AFTP server with the aftp_set_destination call before issuing this call.

AFTP_ENTRY aftp_connect(
IN AFTP_HANDLE_TYPE
connection_id,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
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;
    AFTP_RETURN_CODE_TYPE         aftp_rc;

    /*
     * Before issuing the example call, you must have:
     * a connection_id, use:  aftp_create()
     * a destination, use:    aftp_set_destination()
     */

    /*
     * Establish a connection to the server
     */

    aftp_connect(connection_id, &aftp_rc);
    if (aftp_rc != AFTP_RC_OK) {
        fprintf(
            stderr,
            "Error on aftp_connect(): %s\n",
            aftp_rc);
    }
}
 

Line Flows

The aftp_connect call causes an ALLOCATE verb to be issued to the server. When a conversation is established, an exchange of version numbers and capabilities occurs between the client and the server. Therefore, this call does not return until either AFTP verifies that the server program is running correctly on the remote system or an error occurs.