| 64 | } |
| 65 | |
| 66 | void connection::do_write() |
| 67 | { |
| 68 | auto self(shared_from_this()); |
| 69 | boost::asio::async_write(socket_, reply_.to_buffers(), |
| 70 | [this, self](boost::system::error_code ec, std::size_t) |
| 71 | { |
| 72 | if (!ec) |
| 73 | { |
| 74 | // Initiate graceful connection closure. |
| 75 | boost::system::error_code ignored_ec; |
| 76 | socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, |
| 77 | ignored_ec); |
| 78 | } |
| 79 | |
| 80 | // No new asynchronous operations are started. This means that |
| 81 | // all shared_ptr references to the connection object will |
| 82 | // disappear and the object will be destroyed automatically after |
| 83 | // this handler returns. The connection class's destructor closes |
| 84 | // the socket. |
| 85 | }); |
| 86 | } |
| 87 | |
| 88 | } // namespace server3 |
| 89 | } // namespace http |
nothing calls this directly
no test coverage detected