MCPcopy Create free account
hub / github.com/boostorg/asio / async_read

Method async_read

example/cpp11/serialization/connection.hpp:83–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>

Callers 1

handle_connectMethod · 0.45

Calls 4

async_readFunction · 0.85
bufferFunction · 0.85
bindFunction · 0.50
refClass · 0.50

Tested by

no test coverage detected