18 # define BOOST_ASIO_DISABLE_IOCP
22 # ifdef INADDR_BROADCAST
23 # undef INADDR_BROADCAST
30 #include <boost/asio.hpp>
31 #include <boost/optional.hpp>
96 typedef boost::asio::ip::tcp::resolver
resolver;
99 typedef boost::asio::ip::tcp::socket
socket;
107 const boost::system::error_code& ec,
113 const boost::system::error_code& ec,
118 const boost::system::error_code& ec
126 void handle_write(
const boost::system::error_code& ec, std::size_t bytes_transferred);
128 void handle_read(
const boost::system::error_code& ec, std::size_t bytes_transferred);
an error occured inside the underlying network comminication code (boost asio) TODO: find a short nam...
std::size_t bytes_written_
std::size_t bytes_read() const
void connect(resolver::iterator iterator)
std::size_t bytes_to_write_
void handle_handshake(const boost::system::error_code &ec)
std::size_t bytes_to_read() const
void handle_resolve(const boost::system::error_code &ec, resolver::iterator iterator)
boost::uint32_t payload_size_
bool receive_data(config &result)
void cancel()
Run asio's event loop.
std::size_t is_read_complete(const boost::system::error_code &error, std::size_t bytes_transferred)
void send_data(const configr_of &request)
void handle_read(const boost::system::error_code &ec, std::size_t bytes_transferred)
std::size_t poll()
Handle all pending asynchonous events and return.
A class that represents a TCP/IP connection to the wesnothd server.
const GLuint GLenum const GLvoid * binary
std::list< config > recv_queue_
boost::asio::io_service io_service_
std::size_t bytes_to_write() const
bool handshake_finished() const
True if connected and no high-level operation is in progress.
void handle_write(const boost::system::error_code &ec, std::size_t bytes_transferred)
boost::asio::streambuf read_buf_
std::size_t bytes_to_read_
twesnothd_connection(const std::string &host, const std::string &service)
Constructor.
std::list< boost::asio::streambuf > send_queue_
wesnothd_connection_error error
void handle_connect(const boost::system::error_code &ec, resolver::iterator iterator)
bool has_data_received() const
A config object defines a single node in a WML file, with access to child nodes.
union twesnothd_connection::@26 handshake_response_
bool is_sending_data() const
std::size_t is_write_complete(const boost::system::error_code &error, std::size_t bytes_transferred)
boost::asio::ip::tcp::socket socket
GLsizei const GLcharARB ** string
std::size_t bytes_written() const
boost::asio::ip::tcp::resolver resolver