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