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 | addCmdDownload (SOCKETALT sock, NetBuffer &buffer) |
void | cleanDownload (SOCKETALT s) |
void | lower_check_queues () |
The download manager on the server side works in the networking thread as well. It does not catch CMD_DOWNLOAD messages from the client, but it is handed these requests by NetServer::processPacket. It doesn't care about the client, but only about the socket that connects the server to the client. The download manager could run in a separate process, but that would make it very difficult to manage the connection bandwidth.
Definition at line 177 of file vsnet_dloadmgr.h.
VsnetDownload::Server::Manager::Manager | ( | SocketSet & | set, |
const char ** | local_search_paths | ||
) |
VsnetDownload::Server::Manager::Manager | ( | SocketSet & | set) |
NetServer::processPacket calls this. NetServer doesn't care, but we process the NetBuffer actually already in the main thread before triggering wakeup.
Definition at line 499 of file vsnet_dloadmgr.cpp.
References NetBuffer::addChar(), NetBuffer::addShort(), NetBuffer::addString(), VsnetDownload::RecvCmdDownload::asDownloadRequest(), VsnetDownload::RecvCmdDownload::asResolveRequest(), c, CMD_DOWNLOAD, COMPRESSED, COUT, VsnetDownload::DownloadRequest, f, accountXML::file, VsnetDownload::Adapter::ResolveRequest::files, VsnetDownload::Adapter::DownloadRequest::files, NetBuffer::getData(), NetBuffer::getDataLength(), getZoneInfoBuffer(), VSMutex::lock(), LOPRI, VsnetDownload::Adapter::ResolveRequest::num, VsnetDownload::Adapter::DownloadRequest::num, VsnetDownload::RecvCmdDownload::parse(), PSEUDO__LINE__, VsnetOSS::recv(), VsnetDownload::ResolveResponse, Packet::send(), SENDRELIABLE, VSFileSystem::VSFile::Size(), VsnetDownload::UnexpectedSubcommand, VSMutex::unlock(), SocketSet::wakeup(), and VSFileSystem::ZoneBuffer.
void VsnetDownload::Server::Manager::cleanDownload | ( | SOCKETALT | s) |
The NetServer must tell the download manager that a socket has been closed or is otherwise expired. : function needs cleanup (via mutex or private_lower*) - there is a bad race right now.
Definition at line 599 of file vsnet_dloadmgr.cpp.
References COUT.
void VsnetDownload::Server::Manager::lower_check_queues | ( | ) |
Called by SocketSet after each round.
Definition at line 606 of file vsnet_dloadmgr.cpp.
References COUT, done, VSMutex::lock(), q, and VSMutex::unlock().