The Battle for Wesnoth  1.19.2+dev
Classes | Typedefs | Functions | Variables
server_base.hpp File Reference

Base class for servers using Wesnoth's WML over TCP protocol. More...

#include "exceptions.hpp"
#include "server/common/simple_wml.hpp"
#include <variant>
#include "utils/general.hpp"
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/shared_array.hpp>
#include <map>
Include dependency graph for server_base.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  server_shutdown
class  server_base
 Base class for implementing servers that use gzipped-WML network protocol. More...


typedef std::shared_ptr< boost::asio::ip::tcp::socket > socket_ptr
typedef std::shared_ptr< boost::asio::ssl::stream< socket_ptr::element_type > > tls_socket_ptr
typedef std::variant< socket_ptr, tls_socket_ptrany_socket_ptr


template<class SocketPtr >
std::string client_address (SocketPtr socket)
template<class SocketPtr >
std::string log_address (SocketPtr socket)
template<class SocketPtr >
bool check_error (const boost::system::error_code &error, SocketPtr socket)


bool dump_wml

Detailed Description

Base class for servers using Wesnoth's WML over TCP protocol.

Definition in file server_base.hpp.

Typedef Documentation

◆ any_socket_ptr

typedef std::variant<socket_ptr, tls_socket_ptr> any_socket_ptr

Definition at line 52 of file server_base.hpp.

◆ socket_ptr

typedef std::shared_ptr<boost::asio::ip::tcp::socket> socket_ptr

Definition at line 50 of file server_base.hpp.

◆ tls_socket_ptr

typedef std::shared_ptr<boost::asio::ssl::stream<socket_ptr::element_type> > tls_socket_ptr

Definition at line 51 of file server_base.hpp.

Function Documentation

◆ check_error()

template<class SocketPtr >
bool check_error ( const boost::system::error_code &  error,
SocketPtr  socket 

◆ client_address()

template<class SocketPtr >
std::string client_address ( SocketPtr  socket)

Definition at line 240 of file server_base.cpp.

Referenced by log_address(), and server_base::serve().

◆ log_address()

template<class SocketPtr >
std::string log_address ( SocketPtr  socket)

Variable Documentation

◆ dump_wml

bool dump_wml

Definition at line 58 of file server_base.cpp.

Referenced by server_base::coro_send_doc(), and main().