aftp_query_bytes_transferred

The aftp_query_bytes_transferred call queries the total number of bytes transferred after either an aftp_send_file or aftp_receive_file call has completed. The number of bytes transferred is valid only after a file transfer operation has completed. A connection to the AFTP server must be established before using this call.

AFTP_ENTRY aftp_query_bytes_transferred(
IN AFTP_HANDLE_TYPE
connection_id,
OUT AFTP_LENGTH_TYPE AFTP_PTR
bytes_transferred,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
bytes_transferred
The number of bytes of data transferred during the last send or receive file operation.
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;
    AFTP_LENGTH_TYPE        number_bytes;

    /*
     * Before issuing the example call, you must have:
     *    a connection_id, use:         aftp_create()
     *    a connection to server, use:  aftp_connect()
     *    completed a send or receive, use:  aftp_send()
     *    or aftp_receive()
     */

    aftp_query_bytes_transferred(
        connection_id,
        &number_bytes,
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error getting number bytes transferred.\n");
    } else {
        fprintf(stdout, "Number of bytes %d.\n", (int)number_bytes);
    }
}
 

Line Flows

None.