This is an implicit strand.
io_context::run() 是隐式串行执行completion handler 的,这是它做出的保证。
- The underlying memory is explicitly accessed using the
data()
member function. In general an application should never need to do this, but it is required by the library implementation to pass the raw memory to the underlying operating system functions.boost::Asio强烈不建议对底层memory有操作,但是有时候会直接搬运原始内存数据给操作系统的底层函数
_GLIBCXX_DEBUG
该编译选项使能gcc的迭代器检查 (BOOST_ASIO_ENABLE_BUFFER_DEBUGGING和BOOST_ASIO_DISABLE_BUFFER_DEBUGGING),这回损失一些性能,建议只在调试时使用std::vector<int> v(1) std::vector<int>::iterator i = v.begin(); v.clear(); // invalidates iterators *i = 0; // assertion!
boost.Asio中大多数IO对象是面向流的,没有msg的概念和边界,只有不断的字节流