首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

boost:asio使用async_read_some怎么判定已经读取完毕

2012-02-08 
boost::asio使用async_read_some如何判定已经读取完毕?boost::asio中的异步方式async_read_some只要有数据

boost::asio使用async_read_some如何判定已经读取完毕?
boost::asio中的异步方式async_read_some只要有数据就会执行回调,我不清楚怎么判断是否已经读取完毕,请大家帮忙?

[解决办法]
while 累加, 缓冲区 偏移
[解决办法]
这个代码没有问题,最好同时检查一下错误码。

[解决办法]

C/C++ code
template<    typename MutableBufferSequence,    typename ReadHandler>void async_read_some(    const MutableBufferSequence & buffers,    ReadHandler handler);//handlervoid handler(  const boost::system::error_code& error, // Result of operation.  std::size_t bytes_transferred           // Number of bytes read.); 

热点排行