15 #ifndef NETWORK_ASIO_HPP_INCLUDED
16 #define NETWORK_ASIO_HPP_INCLUDED
19 # define BOOST_ASIO_DISABLE_IOCP
23 # ifdef INADDR_BROADCAST
24 # undef INADDR_BROADCAST
31 #include <boost/asio.hpp>
32 #include <boost/optional.hpp>
48 typedef boost::asio::ip::tcp::resolver
resolver;
51 typedef boost::asio::ip::tcp::socket
socket;
60 const boost::system::error_code& ec,
66 const boost::system::error_code& ec,
71 const boost::system::error_code& ec
79 const boost::system::error_code&
error,
80 std::size_t bytes_transferred
83 const boost::system::error_code& ec,
84 std::size_t bytes_transferred
87 const boost::system::error_code&
error,
88 std::size_t bytes_transferred
91 const boost::system::error_code& ec,
92 std::size_t bytes_transferred,
116 return io_service_.poll();
117 }
catch(
const boost::system::system_error&
err) {
118 if(err.code() == boost::asio::error::operation_aborted)
120 throw error(err.code());
128 void run() { io_service_.run(); }
boost::asio::ip::tcp::socket socket
void handle_read(const boost::system::error_code &ec, std::size_t bytes_transferred, config &response)
boost::asio::streambuf write_buf_
connection(const std::string &host, const std::string &service)
Constructor.
static l_noret error(LoadState *S, const char *why)
std::size_t bytes_to_read_
boost::asio::streambuf read_buf_
std::size_t bytes_to_write() const
void handle_connect(const boost::system::error_code &ec, resolver::iterator iterator)
std::size_t is_write_complete(const boost::system::error_code &error, std::size_t bytes_transferred)
std::size_t bytes_read() const
boost::asio::ip::tcp::resolver resolver
std::size_t bytes_to_write_
union network_asio::connection::@21 handshake_response_
const GLuint GLenum const GLvoid * binary
void handle_write(const boost::system::error_code &ec, std::size_t bytes_transferred)
std::size_t is_read_complete(const boost::system::error_code &error, std::size_t bytes_transferred)
A class that represents a TCP/IP connection.
error(const boost::system::error_code &error)
std::size_t bytes_to_read() const
void connect(resolver::iterator iterator)
void transfer(const config &request, config &response)
boost::uint32_t payload_size_
boost::asio::io_service io_service_
bool done() const
True if connected and no high-level operation is in progress.
std::size_t bytes_written_
void run()
Run asio's event loop.
Base class for all the errors encountered by the engine.
GLsizei GLenum GLuint GLuint GLsizei char * message
std::size_t poll()
Handle all pending asynchonous events and return.
A config object defines a single node in a WML file, with access to child nodes.
void handle_resolve(const boost::system::error_code &ec, resolver::iterator iterator)
std::size_t bytes_written() const
GLsizei const GLcharARB ** string
void handle_handshake(const boost::system::error_code &ec)