i am developing a program that needs to read all the data from a boost::asio::ssl::stream<boost::beast::tcp_stream>
, etc a http webpage.
I have tried reading until EOF which works however it relies on the server closing the connection which is terribly inefficient when sending heavy amounts of requests (which may be common for the context my program is designed to be used in), so ideally id like to find another method.
I attempted using content-length headers but it is not reliable due to it not being mandatory for servers to use, i am interested in using 'tcp frames' however i cannot figure how to use with boost
I also also tried Stream->async_read_some(boost::asio::buffer(*buff, 1448) boost::bind(blahblah))
and reading until i get a bytes_transferred
that is below 1448 but such method does not seem to work.
Notes:Using socket_base::bytes_readable
only seems to work on for getting the size of the encrypted data.
reading until a second \r\n\r\n
wont work due to handling a myriad of file types.
Many thanks. <3