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

Method on_connect

example/http/client/crawl/http_crawl.cpp:233–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 }
232
233 void
234 on_connect(beast::error_code ec, tcp::resolver::results_type::endpoint_type)
235 {
236 if(ec)
237 {
238 report_.aggregate(
239 [](crawl_report& rep)
240 {
241 ++rep.connect_failures;
242 });
243 return do_get_host();
244 }
245
246 // Set a timeout on the operation
247 stream_.expires_after(std::chrono::seconds(10));
248
249 // Send the HTTP request to the remote host
250 http::async_write(
251 stream_,
252 req_,
253 beast::bind_front_handler(
254 &worker::on_write,
255 shared_from_this()));
256 }
257
258 void
259 on_write(

Callers

nothing calls this directly

Calls 3

bind_front_handlerFunction · 0.85
aggregateMethod · 0.80
async_writeFunction · 0.50

Tested by

no test coverage detected