Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. int buff_length = 8192;
  2. ifstream stream;
  3. char* buffer = new char[buff_length];
  4.  
  5. stream.open( path.string().c_str(), ios::binary );
  6.  
  7. boost::system::error_code ignored_error;
  8.  
  9. while (stream)
  10. {
  11. stream.read(buffer, buff_length);
  12. boost::asio::write(*socket, boost::asio::buffer(buffer, stream.gcount()),
  13. boost::asio::transfer_all(), ignored_error);
  14. }
Add Comment
Please, Sign In to add comment