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

Method do_read_header

example/cpp11/chat/chat_client.cpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void do_read_header()
66 {
67 boost::asio::async_read(socket_,
68 boost::asio::buffer(read_msg_.data(), chat_message::header_length),
69 [this](boost::system::error_code ec, std::size_t /*length*/)
70 {
71 if (!ec && read_msg_.decode_header())
72 {
73 do_read_body();
74 }
75 else
76 {
77 socket_.close();
78 }
79 });
80 }
81
82 void do_read_body()
83 {

Callers

nothing calls this directly

Calls 5

async_readFunction · 0.85
bufferFunction · 0.85
decode_headerMethod · 0.80
dataMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected