forked fromglynos/cpp-netlib
- Notifications
You must be signed in to change notification settings - Fork425
Closed
Milestone
Description
In my code I use io_service with strictly one thread (for various reasons). But when I pass this io_service to http::client as argument in (in network::http::client::options) it adds new thread to io_service - which breaks my code. Here is the offencive code inasync_impl.http:60
lifetime_thread_.reset(new boost::thread( boost::bind(&boost::asio::io_service::run, &service_)));The thread is created whether io_service was passed from outside or not.
IMHO, if user passes io_service from outside then http::client cannot change it nor release it as it is external reasource.
For now I fixed it locally by
if (!service){ lifetime_thread_.reset(new boost::thread( boost::bind(&boost::asio::io_service::run, &service_)));}Metadata
Metadata
Assignees
Labels
No labels