boost::Asio

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的概念和边界,只有不断的字节流

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值