network.hpp File Reference

#include "SDL_net.h"
#include <string>
#include <vector>

Include dependency graph for network.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  threading
namespace  network

Classes

struct  network::pending_statistics
struct  network::manager
struct  network::server_manager
 A server manager causes listening on a given port to occur for the duration of its lifetime. More...
struct  network::connection_stats
struct  network::error
struct  network::statistics

Typedefs

typedef int network::connection

Functions

pending_statistics network::get_pending_stats ()
void network::set_raw_data_only ()
size_t network::nconnections ()
 The number of peers we are connected to.
bool network::is_server ()
 If we are currently accepting connections.
connection network::connect (const std::string &host, int port=15000)
 Function to attempt to connect to a remote host.
connection network::connect (const std::string &host, int port, threading::waiter &waiter)
connection network::accept_connection ()
 Function to accept a connection from a remote host.
bool network::disconnect (connection connection_num=0, bool force=false)
 Function to disconnect from a certain host, or close all connections if connection_num is 0.
void network::queue_disconnect (connection connection_num)
 Function to queue a disconnection.
connection network::receive_data (config &cfg, connection connection_num=0)
 Function to receive data from either a certain connection, or all connections if connection_num is 0.
connection network::receive_data (config &cfg, connection connection_num, unsigned int timeout)
connection network::receive_data (std::vector< char > &buf)
void network::send_data (const config &cfg, connection connection_num, const bool gzipped)
 Function to send data down a given connection, or broadcast to all peers if connection_num is 0.
void network::send_raw_data (const char *buf, int len, connection connection_num)
void network::process_send_queue (connection connection_num=0, size_t max_size=0)
 Function to send any data that is in a connection's send_queue, up to a maximum of 'max_size' bytes -- or the entire send queue if 'max_size' bytes is 0.
void network::send_data_all_except (const config &cfg, connection connection_num, const bool gzipped)
 Function to send data to all peers except 'connection_num'.
std::string network::ip_address (connection connection_num)
 Function to get the remote ip address of a socket.
connection_stats network::get_connection_stats (connection connection_num)
statistics network::get_send_stats (connection handle)
 Function to see the number of bytes being processed on the current socket.
statistics network::get_receive_stats (connection handle)

Variables

connection const network::null_connection = 0


Detailed Description

Definition in file network.hpp.


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs