Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it more efficient to use boost::asio::basic_stream_socket::async_read_some instead of boost::asio::async_read?

Is it better to use boost::asio::basic_stream_socket::async_read_some instead of boost::asio::async_read when it comes to high performance data throughput?

like image 662
Jan Deinhard Avatar asked Aug 04 '10 20:08

Jan Deinhard


1 Answers

boost::asio::async_read is a composed operation, which is well described in the documentation

This operation is implemented in terms of zero or more calls to the stream's async_read_some function, and is known as a composed operation. The program must ensure that the stream performs no other read operations (such as async_read, the stream's async_read_some function, or any other composed operations that perform reads) until this operation completes.

any performance conclusions should be based on empirical data depending on your application.

like image 68
Sam Miller Avatar answered Oct 18 '22 17:10

Sam Miller