The aftp_close call closes an active connection. A connection to the AFTP server must be established before using this call.
AFTP_ENTRY aftp_close(
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 connection to server, use: aftp_connect()
*/
aftp_close(connection_id, &aftp_rc);
if (aftp_rc != AFTP_RC_OK) {
fprintf(
stderr,
"Error on aftp_close(): %s\n",
aftp_rc);
}
The close operation causes a DEALLOCATE verb to be issued with an AP_FLUSH parameter, forcing any buffer contents to flow to the server before deallocating the conversation.