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

Method do_read

example/advanced/server/advanced_server.cpp:366–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364
365private:
366 void
367 do_read()
368 {
369 // Construct a new parser for each message
370 parser_.emplace();
371
372 // Apply a reasonable limit to the allowed size
373 // of the body in bytes to prevent abuse.
374 parser_->body_limit(10000);
375
376 // Set the timeout.
377 stream_.expires_after(std::chrono::seconds(30));
378
379 // Read a request using the parser-oriented interface
380 http::async_read(
381 stream_,
382 buffer_,
383 *parser_,
384 beast::bind_front_handler(
385 &http_session::on_read,
386 shared_from_this()));
387 }
388
389 void
390 on_read(beast::error_code ec, std::size_t bytes_transferred)

Callers

nothing calls this directly

Calls 4

bind_front_handlerFunction · 0.85
emplaceMethod · 0.80
body_limitMethod · 0.80
async_readFunction · 0.50

Tested by

no test coverage detected