Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <vsnet_dloadmgr.h>
Public Member Functions | |
Manager (SocketSet &set, const char **local_search_paths) | |
Manager (SocketSet &set) | |
void | addItem (Item *item) |
void | addItems (std::list< Item * > &items) |
void | processCmdDownload (SOCKETALT sock, NetBuffer &buffer) |
void | lower_check_queues () |
The download manager works in the networking thread. New requests are added from all threads, and notifications may interfere with the Items that are owned by other threads, but the management of files and buffers is handled entirely in the networking threads.
Definition at line 53 of file vsnet_dloadmgr.h.
VsnetDownload::Client::Manager::Manager | ( | SocketSet & | set, |
const char ** | local_search_paths | ||
) |
VsnetDownload::Client::Manager::Manager | ( | SocketSet & | set) |
void VsnetDownload::Client::Manager::addItem | ( | Item * | item) |
Definition at line 79 of file vsnet_dloadmgr.cpp.
References addItems().
void VsnetDownload::Client::Manager::addItems | ( | std::list< Item * > & | items) |
Definition at line 86 of file vsnet_dloadmgr.cpp.
References VsnetDownload::Client::Item::changeState(), VsnetDownload::Client::Completed, COUT, VSFileSystem::FileNotFound, VsnetDownload::Client::Item::getFilename(), VSMutex::lock(), VsnetDownload::Client::Queued, VSMutex::unlock(), and SocketSet::wakeup().
Referenced by addItem().
void VsnetDownload::Client::Manager::lower_check_queues | ( | ) |
Called by SocketSet after each round.
Definition at line 140 of file vsnet_dloadmgr.cpp.
NetClient::recvMsg calls this for answers from a server mgr (currently only from the server because no other socket is checked).
Definition at line 111 of file vsnet_dloadmgr.cpp.
References c, COUT, VsnetDownload::Download, VsnetDownload::DownloadError, VsnetDownload::DownloadFirstFragment, VsnetDownload::DownloadFragment, VsnetDownload::DownloadLastFragment, VsnetDownload::DownloadRequest, NetBuffer::getChar(), VsnetDownload::ResolveRequest, VsnetDownload::ResolveResponse, and VsnetDownload::UnexpectedSubcommand.