#include <boost/asio/io_service.hpp>
#include <boost/asio/steady_timer.hpp>
#include <chrono>
#include <thread>
#include <iostream>
using namespace boost::asio;
int main()
{
io_service ioservice;
steady_timer timer1{ ioservice, std::chrono::seconds(1) };
timer1.async_wait([](const boost::system::error_code & /* e */) {
for (int i = 0; i <
boost asio的异步事件处理函数是在执行异步事件的run函数所在的线程里面执行的
最新推荐文章于 2022-09-19 18:43:18 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)