MCPcopy Create free account
hub / github.com/boostorg/beast / on_read

Method on_read

example/http/client/async-ssl/http_client_async_ssl.cpp:164–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163
164 void
165 on_read(
166 beast::error_code ec,
167 std::size_t bytes_transferred)
168 {
169 boost::ignore_unused(bytes_transferred);
170
171 if(ec)
172 return fail(ec, "read");
173
174 // Write the message to standard out
175 std::cout << res_ << std::endl;
176
177 // Set a timeout on the operation
178 beast::get_lowest_layer(stream_).expires_after(std::chrono::seconds(30));
179
180 // Gracefully close the stream
181 stream_.async_shutdown(
182 beast::bind_front_handler(
183 &session::on_shutdown,
184 shared_from_this()));
185 }
186
187 void
188 on_shutdown(beast::error_code ec)

Callers

nothing calls this directly

Calls 2

bind_front_handlerFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected