FC++  v0.7.1-1067
FileCatalyst Fast File Transfers - C++ Library
example004.cpp File Reference

Use a 2nd thread combined with fc::Control::getMostRecentFileStats() to display a simple progress indicator while the original thread completes a download using fc::Control::prepareSingleFile() and fc::Control::download(). More...

#include "FileCatalyst.hpp"
#include <iostream>
#include <iomanip>
#include <thread>
Include dependency graph for example004.cpp:

Functions

void example004_progress_thread (void)
 
int example004 (void)
 
int main (int argc, char *argv[])
 

Variables

const std::string username = TEST_USER
 
const std::string password = TEST_PASS
 
const std::string serverIP = TEST_SERVER
 
const fc::TransferStatsstats = NULL
 
bool showProgress = true
 

Detailed Description

Use a 2nd thread combined with fc::Control::getMostRecentFileStats() to display a simple progress indicator while the original thread completes a download using fc::Control::prepareSingleFile() and fc::Control::download().

Function Documentation

void example004_progress_thread ( void  )

References fc::formatTimeDuration(), fc::TransferStats::payloadBytesExpected, fc::TransferStats::payloadBytesTransferred, showProgress, and fc::TransferStats::timeRemaining.

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

References example004().

Here is the call graph for this function:

Variable Documentation

const std::string username = TEST_USER
const std::string password = TEST_PASS
const std::string serverIP = TEST_SERVER
const fc::TransferStats* stats = NULL
bool showProgress = true