| 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 | { |
nothing calls this directly
no test coverage detected