eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.61k stars 751 forks source link

httpclient :Can i read the response in the same thread which sent request. #216

Open hedemonde opened 6 years ago

hedemonde commented 6 years ago

HI:

I use http_client in multiple threads. and the threads managed by boost. can I read response with the thread which send it's request? need I use strand.wrap the callback of asio::async_write and asio::async_read ?

thanks

eidheim commented 6 years ago

Sorry for the late response. I take it you use the async request functions, and then the handlers will be run on the same thread that the client's io_service event processing loop is executed. If you have several event processing loops running on the same io_service, the handlers can run on all the different threads that run the processing loops.