Beast Logo

PrevUpHomeNext

Using I/O

This library makes I/O primitives used by the implementation publicly available so users can take advantage of them in their own libraries. These primitives include traits, buffers, buffer algorithms, files, and helpers for implementing asynchronous operations compatible with Boost.Asio and described in N3747. This section lists these facilities by group, with descriptions.

[Important] Important

This documentation assumes familiarity with Boost.Asio. Sample code and identifiers used throughout are written as if the following declarations are in effect:

#include <beast/core.hpp>
#include <boost/asio.hpp>
#include <iostream>
#include <thread>
//
using namespace beast;

boost::asio::io_service ios;
boost::asio::io_service::work work{ios};
std::thread t{[&](){ ios.run(); }};

error_code ec;
boost::asio::ip::tcp::socket sock{ios};

PrevUpHomeNext