So I tried:
int buff_length = 8192;
ifstream stream;
char* buffer = new char[buff_length];
stream.open( path.string().c_str(), ios::binary );
boost::system::error_code ignored_error;
while (stream)
{
stream.read(buffer, buff_length);
boost::asio::write(*socket, boost::asio::buffer(buffer, stream.gcount()),
boost::asio::transfer_all(), ignored_error);
}
I wonder how you do it - how to do it faster?
My application should work through Windows, Linux and Mac OS. That is why I use boost alot. I use abfor testing. I want to get 2 or at least 1.5 times faster when reading and sending files. Maybe Boost :: Iostream can help me how?
Rella source
share