I'm a novice at boost.
I'm testing boost async client. the reference code is as below.
the code is well done if "Connection: close"
header value exists. but, "handle_read_status_line"
handler was never invoked when I omitted "Conneciton: close"
header in the HTTP request. (all handler for receiving HTTP response are invoked only when TCP connection is closed.)
In my opinion, "handle_read_status_line"
should be invoked because HTTP response always include "\\\\r\\\\n"
regardless of "Connection"
header.
Could anybody explain to me when the handler for async_read_until
is invoked?
Thanks in advance.
In general, async_read_until
returns when the MatchCondition
has been met.
The sample assumes that the connection is per-request. It's pretty explicit in that:
// Start reading remaining data until EOF.
boost::asio::async_read(socket_, response_,
boost::asio::transfer_at_least(1),
boost::bind(&client::handle_read_content, this,
boost::asio::placeholders::error));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.