Public Types | Public Member Functions | Private Attributes

network::server_manager Struct Reference

A server manager causes listening on a given port to occur for the duration of its lifetime. More...

#include <network.hpp>

List of all members.

Public Types

enum  CREATE_SERVER { MUST_CREATE_SERVER, TRY_CREATE_SERVER, NO_SERVER }
 

Parameter to pass to the constructor.

More...

Public Member Functions

 server_manager (int port, CREATE_SERVER create_server=MUST_CREATE_SERVER)
 ~server_manager ()
bool is_running () const
void stop ()

Private Attributes

bool free_
connection connection_

Detailed Description

A server manager causes listening on a given port to occur for the duration of its lifetime.

Definition at line 81 of file network.hpp.


Member Enumeration Documentation

Parameter to pass to the constructor.

Enumerator:
MUST_CREATE_SERVER 

Will throw exception on failure.

TRY_CREATE_SERVER 

Will swallow failure.

NO_SERVER 

Definition at line 84 of file network.hpp.


Constructor & Destructor Documentation

network::server_manager::server_manager ( int  port,
CREATE_SERVER  create_server = MUST_CREATE_SERVER 
)

Definition at line 307 of file network.cpp.

References network::connect(), connection_, DBG_NW, free_, get_socket(), MUST_CREATE_SERVER, and NO_SERVER.

Here is the call graph for this function:

network::server_manager::~server_manager (  ) 

Definition at line 326 of file network.cpp.

References stop().

Here is the call graph for this function:


Member Function Documentation

bool network::server_manager::is_running (  )  const

Definition at line 341 of file network.cpp.

void network::server_manager::stop (  ) 

Definition at line 331 of file network.cpp.

References connection_, free_, and remove_connection().

Referenced by server::restart_handler(), server::shut_down_handler(), and ~server_manager().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 97 of file network.hpp.

Referenced by server_manager(), and stop().

Definition at line 96 of file network.hpp.

Referenced by server_manager(), and stop().


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

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