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

Method do_write

example/cpp11/http/server/connection.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void connection::do_write()
72{
73 auto self(shared_from_this());
74 boost::asio::async_write(socket_, reply_.to_buffers(),
75 [this, self](boost::system::error_code ec, std::size_t)
76 {
77 if (!ec)
78 {
79 // Initiate graceful connection closure.
80 boost::system::error_code ignored_ec;
81 socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both,
82 ignored_ec);
83 }
84
85 if (ec != boost::asio::error::operation_aborted)
86 {
87 connection_manager_.stop(shared_from_this());
88 }
89 });
90}
91
92} // namespace server
93} // namespace http

Callers

nothing calls this directly

Calls 4

async_writeFunction · 0.85
to_buffersMethod · 0.45
shutdownMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected