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