aftp_close

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

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

Line Flows

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.