Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
Add Comment
Please, Sign In to add comment