added new DL mode: Progressive. This is a random mode that ensures no more than 50MB of free space will be written in the file at once. This should effectively remove the lag when initiating a DL on a big file, while keeping enough entropy to ensure a good dissemination of chunks

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6164 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-02-28 20:42:01 +00:00
parent 2d74a3012a
commit 4f1dda2ffb
10 changed files with 76 additions and 24 deletions

View file

@ -76,7 +76,7 @@ int main()
std::string fname = "source_tmp.bin" ;
std::string fname_copy_1 = "copy_1_tmp.bin" ;
std::string fname_copy_2 = "copy_2_tmp.bin" ;
uint64_t size = 5000000 ;
uint64_t size = 100000000 ;
std::string hash = "" ;
pthread_t seed = 8;//getpid() ;
@ -92,6 +92,9 @@ int main()
ftFileCreator *client1 = new ftFileCreator(fname_copy_1,size,hash,false) ;
ftFileCreator *client2 = new ftFileCreator(fname_copy_2,size,hash,false) ;
client1->setChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_RANDOM) ;
client2->setChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_PROGRESSIVE) ;
// 3 - Exchange chunks, and build two copies of the file.
//
std::string peer_id_1("client peer id 1") ;