webcc icon indicating copy to clipboard operation
webcc copied to clipboard

如何复用io_service

Open windflowerly opened this issue 3 years ago • 2 comments

我的项目中也使用了io_service.如何才能复用项目中的io_service

windflowerly avatar Sep 28 '21 09:09 windflowerly

现在新版的asio用io_context替换掉了io_service。问题改为如何复用项目中已有的io_context

windflowerly avatar Sep 28 '21 09:09 windflowerly

现在新版的asio用io_context替换掉了io_service。问题改为如何复用项目中已有的io_context

不必复用,也不该复用,每一个 webcc::ClientSession 都有一个 io_context,跑在一个单独的线程里。 你自己项目里的 io_context 通常也应该跑在一个线程里。

sprinfall avatar Oct 09 '21 01:10 sprinfall