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

Method do_write

example/cpp11/chat/chat_client.cpp:101–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 void do_write()
102 {
103 boost::asio::async_write(socket_,
104 boost::asio::buffer(write_msgs_.front().data(),
105 write_msgs_.front().length()),
106 [this](boost::system::error_code ec, std::size_t /*length*/)
107 {
108 if (!ec)
109 {
110 write_msgs_.pop_front();
111 if (!write_msgs_.empty())
112 {
113 do_write();
114 }
115 }
116 else
117 {
118 socket_.close();
119 }
120 });
121 }
122
123private:
124 boost::asio::io_context& io_context_;

Callers

nothing calls this directly

Calls 7

async_writeFunction · 0.85
bufferFunction · 0.85
frontMethod · 0.80
lengthMethod · 0.80
dataMethod · 0.45
emptyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected