Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何复用io_service #25

Open
windflowerly opened this issue Sep 28, 2021 · 2 comments
Open

如何复用io_service #25

windflowerly opened this issue Sep 28, 2021 · 2 comments

Comments

@windflowerly
Copy link

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

@windflowerly
Copy link
Author

windflowerly commented Sep 28, 2021

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

Repository owner deleted a comment from windflowerly Oct 9, 2021
@sprinfall
Copy link
Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants