Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <vsnet_notify.h>
Classes | |
class | NotifyConclusion |
Public Member Functions | |
FileSet (boost::shared_ptr< Manager >mgr, SOCKETALT sock, std::list< std::string >filesnames, std::string localbasepath) | |
bool | isDone () const |
void | update (std::string s, bool v) |
We can't really support blocking until a set of files has been downloaded inside this class. The problem is that the variables that we must wait for exist in netserver, netclient and accountserver, and they are called in several places and potentially several threads. Therefore the waiting itself should be handled in those classes. This helper class allows a simple check.
Create a FileSet with the appropriate Manager, the socket to the remote side that you want to use, the list of filenames as string, and the existing(!) directory where you want to store the files. Then call isDone() a couple of times. If it returns true, the downloads are all completed (but they may have failed - if you need to check that, add a function for reading the int values from the member variable _files, 1 success, 0 failure).
Definition at line 369 of file vsnet_notify.h.
VsnetDownload::Client::FileSet::FileSet | ( | boost::shared_ptr< Manager > | mgr, |
SOCKETALT | sock, | ||
std::list< std::string > | filesnames, | ||
std::string | localbasepath | ||
) |
bool VsnetDownload::Client::FileSet::isDone | ( | ) | const |
Definition at line 323 of file vsnet_notify.cpp.
void VsnetDownload::Client::FileSet::update | ( | std::string | s, |
bool | v | ||
) |
Definition at line 328 of file vsnet_notify.cpp.