Namespaces | Defines | 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 <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

namespace  network_worker_pool

Defines

#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:
#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.
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")

Define Documentation

#define DBG_NW   LOG_STREAM(debug, log_network)

Definition at line 91 of file network_worker.cpp.

Referenced by network_worker_pool::manager::~manager().

#define ERR_NW   LOG_STREAM(err, log_network)

Definition at line 93 of file network_worker.cpp.

#define LOG_NW   LOG_STREAM(info, log_network)

Definition at line 92 of file network_worker.cpp.

#define NUM_SHARDS   1

Definition at line 105 of file network_worker.cpp.

#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 70 of file network_worker.cpp.

#define USE_SELECT   1

Definition at line 79 of file network_worker.cpp.


Enumeration Type Documentation

Definition at line 148 of file network_worker.cpp.


Variable Documentation

lg::log_domain log_network("network") [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:08:36 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs