| 81 | /// Asynchronously read a data structure from the socket. |
| 82 | template <typename T, typename Handler> |
| 83 | void async_read(T& t, Handler handler) |
| 84 | { |
| 85 | // Issue a read operation to read exactly the number of bytes in a header. |
| 86 | void (connection::*f)(const boost::system::error_code&, T&, std::tuple<Handler>) |
| 87 | = &connection::handle_read_header<T, Handler>; |
| 88 | boost::asio::async_read(socket_, boost::asio::buffer(inbound_header_), |
| 89 | std::bind(f, |
| 90 | this, boost::asio::placeholders::error, std::ref(t), |
| 91 | std::make_tuple(handler))); |
| 92 | } |
| 93 | |
| 94 | /// Handle a completed read of a message header. |
| 95 | template <typename T, typename Handler> |
no test coverage detected