The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
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>

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 
)
network::server_manager::~server_manager ( )

Definition at line 330 of file network.cpp.

References stop().

Member Function Documentation

bool network::server_manager::is_running ( ) const

Definition at line 345 of file network.cpp.

void network::server_manager::stop ( )

Definition at line 335 of file network.cpp.

References connection_, free_, and remove_connection().

Referenced by ~server_manager().

Member Data Documentation

connection network::server_manager::connection_
private

Definition at line 97 of file network.hpp.

Referenced by server_manager(), and stop().

bool network::server_manager::free_
private

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: