Classes | Public Member Functions | Private Member Functions | Private Attributes

asio_server Class Reference

#include <asio_server.hpp>

Inheritance diagram for asio_server:
Inheritance graph
[legend]
Collaboration diagram for asio_server:
Collaboration graph
[legend]

List of all members.

Classes

class  asio_client_proxy

Public Member Functions

 asio_server ()
virtual ~asio_server ()

Private Member Functions

virtual void set_connection_handler (ana::connection_handler *)
virtual ana::operation_id send_all (boost::asio::const_buffer, ana::send_handler *, ana::send_type)
virtual ana::operation_id send_if (boost::asio::const_buffer, ana::send_handler *, const ana::client_predicate &, ana::send_type)
virtual ana::operation_id send_one (ana::net_id, boost::asio::const_buffer, ana::send_handler *, ana::send_type)
virtual ana::operation_id send_all_except (ana::net_id, boost::asio::const_buffer, ana::send_handler *, ana::send_type)
virtual void set_listener_handler (ana::listener_handler *)
virtual void run_listener ()
virtual void run (ana::port pt)
virtual void deregister_client (client_proxy *client)
virtual std::string ip_address (ana::net_id) const
virtual const ana::statsget_client_stats (ana::net_id, ana::stat_type) const
virtual void log_receive (ana::read_buffer buffer)
virtual const ana::statsget_stats (ana::stat_type type) const
virtual void cancel_pending ()
virtual void cancel_pending (ana::net_id client_id)
virtual void disconnect (ana::net_id)
virtual void disconnect ()
virtual void set_raw_buffer_max_size (size_t)
virtual void wait_raw_object (ana::serializer::bistream &, size_t)
virtual ana::stats_collector & stats_collector ()
virtual ana::timercreate_timer ()
virtual void set_header_first_mode (ana::net_id id)
virtual void set_raw_data_mode (ana::net_id id)
virtual void expecting_message (ana::net_id, size_t ms_until_timeout)
void handle_accept (const boost::system::error_code &ec, asio_client_proxy *client, ana::connection_handler *handler)
void register_client (client_proxy *client)
void run_acceptor_thread (asio_server *obj, ana::connection_handler *)
void async_accept (ana::connection_handler *)

Private Attributes

boost::asio::io_service io_service_
boost::asio::io_service::work work_
std::list< boost::thread * > io_threads_
std::auto_ptr< tcp::acceptor > acceptor_
std::list< client_proxy * > client_proxies_
bool listening_
ana::listener_handlerlistener_
ana::connection_handlerconnection_handler_
asio_client_proxylast_client_proxy_
ana::stats_collector stats_collector_
ana::operation_id last_valid_operation_id_

Detailed Description

Definition at line 55 of file asio_server.hpp.


Constructor & Destructor Documentation

asio_server::asio_server (  ) 

Definition at line 46 of file asio_server.cpp.

asio_server::~asio_server (  )  [virtual]

Definition at line 61 of file asio_server.cpp.

References client_proxies_, io_service_, io_threads_, and last_client_proxy_.


Member Function Documentation

void asio_server::async_accept ( ana::connection_handler handler  )  [private]

Definition at line 116 of file asio_server.cpp.

References acceptor_, error(), handle_accept(), io_service_, last_client_proxy_, and asio_server::asio_client_proxy::socket().

Referenced by handle_accept(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

void asio_server::cancel_pending (  )  [private, virtual]

Definition at line 425 of file asio_server.cpp.

References ana::server::client_proxy::cancel_pending(), and client_proxies_.

Here is the call graph for this function:

void asio_server::cancel_pending ( ana::net_id  client_id  )  [private, virtual]

Definition at line 431 of file asio_server.cpp.

References client_proxies_, and gui2::id.

ana::timer * asio_server::create_timer (  )  [private, virtual]

Definition at line 303 of file asio_server.cpp.

References io_service_.

void asio_server::deregister_client ( client_proxy *  client  )  [private, virtual]

Definition at line 146 of file asio_server.cpp.

References client_proxies_.

void asio_server::disconnect (  )  [private, virtual]

Definition at line 346 of file asio_server.cpp.

References client_proxies_, io_service_, and io_threads_.

void asio_server::disconnect ( ana::net_id  id  )  [private, virtual]

Definition at line 335 of file asio_server.cpp.

References client_proxies_, and gui2::id.

void asio_server::expecting_message ( ana::net_id  id,
size_t  ms_until_timeout 
) [private, virtual]

Definition at line 387 of file asio_server.cpp.

References client_proxies_, and gui2::id.

const ana::stats * asio_server::get_client_stats ( ana::net_id  id,
ana::stat_type  type 
) const [private, virtual]

Definition at line 285 of file asio_server.cpp.

References client_proxies_, and gui2::id.

const ana::stats * asio_server::get_stats ( ana::stat_type  type  )  const [private, virtual]

Definition at line 308 of file asio_server.cpp.

References stats_collector_.

void asio_server::handle_accept ( const boost::system::error_code &  ec,
asio_client_proxy client,
ana::connection_handler handler 
) [private]

Definition at line 151 of file asio_server.cpp.

References async_accept(), ana::connection_handler::handle_connect(), ana::detail::ana_component::id(), ana::detail::ana_component::raw_mode(), register_client(), and ana::detail::ana_component::set_raw_data_mode().

Referenced by async_accept().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string asio_server::ip_address ( ana::net_id  id  )  const [private, virtual]

Definition at line 272 of file asio_server.cpp.

References client_proxies_, and gui2::id.

void asio_server::log_receive ( ana::read_buffer  buffer  )  [private, virtual]

Definition at line 298 of file asio_server.cpp.

References stats_collector_.

void asio_server::register_client ( client_proxy *  client  )  [private]

Definition at line 135 of file asio_server.cpp.

References client_proxies_, listener_, and listening_.

Referenced by handle_accept().

Here is the caller graph for this function:

void asio_server::run ( ana::port  pt  )  [private, virtual]

Definition at line 101 of file asio_server.cpp.

References acceptor_, async_accept(), connection_handler_, io_service_, io_threads_, and run_listener().

Here is the call graph for this function:

void asio_server::run_acceptor_thread ( asio_server obj,
ana::connection_handler  
) [private]
void asio_server::run_listener (  )  [private, virtual]

Definition at line 173 of file asio_server.cpp.

References client_proxies_, and listener_.

Referenced by run().

Here is the caller graph for this function:

ana::operation_id asio_server::send_all ( boost::asio::const_buffer  buffer,
ana::send_handler handler,
ana::send_type  copy_buffer 
) [private, virtual]

Definition at line 250 of file asio_server.cpp.

References client_proxies_, last_valid_operation_id_, and ana::no_operation.

ana::operation_id asio_server::send_all_except ( ana::net_id  id,
boost::asio::const_buffer  buffer,
ana::send_handler handler,
ana::send_type  copy_buffer 
) [private, virtual]

Definition at line 208 of file asio_server.cpp.

References ana::create_predicate(), and send_if().

Here is the call graph for this function:

ana::operation_id asio_server::send_if ( boost::asio::const_buffer  buffer,
ana::send_handler handler,
const ana::client_predicate predicate,
ana::send_type  copy_buffer 
) [private, virtual]

Definition at line 220 of file asio_server.cpp.

References client_proxies_, last_valid_operation_id_, ana::no_operation, and ana::client_predicate::selects().

Referenced by send_all_except(), and send_one().

Here is the call graph for this function:

Here is the caller graph for this function:

ana::operation_id asio_server::send_one ( ana::net_id  id,
boost::asio::const_buffer  buffer,
ana::send_handler handler,
ana::send_type  copy_buffer 
) [private, virtual]

Definition at line 197 of file asio_server.cpp.

References ana::create_predicate(), and send_if().

Here is the call graph for this function:

void asio_server::set_connection_handler ( ana::connection_handler handler  )  [private, virtual]

Definition at line 96 of file asio_server.cpp.

References connection_handler_.

void asio_server::set_header_first_mode ( ana::net_id  id  )  [private, virtual]

Definition at line 398 of file asio_server.cpp.

References client_proxies_, and gui2::id.

void asio_server::set_listener_handler ( ana::listener_handler listener  )  [private, virtual]

Definition at line 184 of file asio_server.cpp.

References client_proxies_, listener_, and listening_.

void asio_server::set_raw_buffer_max_size ( size_t  size  )  [private, virtual]

Definition at line 372 of file asio_server.cpp.

References client_proxies_.

void asio_server::set_raw_data_mode ( ana::net_id  id  )  [private, virtual]

Definition at line 409 of file asio_server.cpp.

References client_proxies_, and gui2::id.

ana::stats_collector & asio_server::stats_collector (  )  [private, virtual]

Definition at line 382 of file asio_server.cpp.

References stats_collector_.

virtual void asio_server::wait_raw_object ( ana::serializer::bistream ,
size_t   
) [inline, private, virtual]

Definition at line 146 of file asio_server.hpp.


Member Data Documentation

std::auto_ptr<tcp::acceptor> asio_server::acceptor_ [private]

Definition at line 171 of file asio_server.hpp.

Referenced by async_accept(), and run().

std::list<client_proxy*> asio_server::client_proxies_ [private]

Definition at line 175 of file asio_server.hpp.

Referenced by run(), and set_connection_handler().

boost::asio::io_service asio_server::io_service_ [private]

Definition at line 168 of file asio_server.hpp.

Referenced by async_accept(), create_timer(), disconnect(), run(), and ~asio_server().

std::list<boost::thread*> asio_server::io_threads_ [private]

Definition at line 170 of file asio_server.hpp.

Referenced by disconnect(), run(), and ~asio_server().

Definition at line 176 of file asio_server.hpp.

Referenced by async_accept(), and ~asio_server().

Definition at line 180 of file asio_server.hpp.

Referenced by send_all(), and send_if().

Definition at line 174 of file asio_server.hpp.

Referenced by register_client(), run_listener(), and set_listener_handler().

bool asio_server::listening_ [private]

Definition at line 173 of file asio_server.hpp.

Referenced by register_client(), and set_listener_handler().

ana::stats_collector asio_server::stats_collector_ [private]

Definition at line 178 of file asio_server.hpp.

Referenced by get_stats(), log_receive(), and stats_collector().

boost::asio::io_service::work asio_server::work_ [private]

Definition at line 169 of file asio_server.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:01 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs