The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Enumerations | Functions | Variables
network_worker.cpp File Reference
#include "global.hpp"
#include "scoped_resource.hpp"
#include "log.hpp"
#include "network_worker.hpp"
#include "filesystem.hpp"
#include "thread.hpp"
#include "serialization/binary_or_text.hpp"
#include "serialization/parser.hpp"
#include "wesconfig.h"
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/exception/info.hpp>
#include <cerrno>
#include <deque>
#include <sstream>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/time.h>
#include <unistd.h>
Include dependency graph for network_worker.cpp:

Go to the source code of this file.

Namespaces

 network_worker_pool
 

Macros

#define SOCKET   int
 Network worker handles data transfers in threads Remember to use mutexs as little as possible All global vars should be used in mutex FIXME: More...
 
#define USE_SELECT   1
 
#define DBG_NW   LOG_STREAM(debug, log_network)
 
#define LOG_NW   LOG_STREAM(info, log_network)
 
#define ERR_NW   LOG_STREAM(err, log_network)
 
#define NUM_SHARDS   1
 

Enumerations

enum  SOCKET_STATE
 

Functions

network::pending_statistics network_worker_pool::get_pending_stats ()
 
void network_worker_pool::set_raw_data_only ()
 
void network_worker_pool::set_use_system_sendfile (bool use)
 
void network_worker_pool::receive_data (TCPsocket sock)
 Function to asynchronously received data to the given socket. More...
 
TCPsocket network_worker_pool::get_received_data (TCPsocket sock, config &cfg, network::bandwidth_in_ptr &bandwidth_in)
 
TCPsocket network_worker_pool::get_received_data (std::vector< char > &out)
 
static void network_worker_pool::queue_buffer (TCPsocket sock, buffer *queued_buf)
 
void network_worker_pool::queue_raw_data (TCPsocket sock, const char *buf, int len)
 
void network_worker_pool::queue_file (TCPsocket sock, const std::string &filename)
 
size_t network_worker_pool::queue_data (TCPsocket sock, const config &buf, const std::string &packet_type)
 
bool network_worker_pool::is_locked (const TCPsocket sock)
 
bool network_worker_pool::close_socket (TCPsocket sock)
 
TCPsocket network_worker_pool::detect_error ()
 
std::pair< network::statistics,
network::statistics
network_worker_pool::get_current_transfer_stats (TCPsocket sock)
 

Variables

static lg::log_domain log_network ("network")
 

Macro Definition Documentation

#define DBG_NW   LOG_STREAM(debug, log_network)
#define ERR_NW   LOG_STREAM(err, log_network)

Definition at line 88 of file network_worker.cpp.

#define LOG_NW   LOG_STREAM(info, log_network)

Definition at line 87 of file network_worker.cpp.

#define NUM_SHARDS   1
#define SOCKET   int

Network worker handles data transfers in threads Remember to use mutexs as little as possible All global vars should be used in mutex FIXME:

Todo:
All code which holds a mutex should run O(1) time for scalability.

Implement read/write locks. (postponed for 1.5)

Definition at line 63 of file network_worker.cpp.

#define USE_SELECT   1

Definition at line 72 of file network_worker.cpp.

Enumeration Type Documentation

Definition at line 143 of file network_worker.cpp.

Variable Documentation

lg::log_domain log_network("network")
static