Skip to content
Snippets Groups Projects
Commit 96fd35e5 authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Stop the IO service when we're shutting down with force=true

This will cause the http::Client to not block & exit immediately
when we're calling Client::close
parent 69be9af8
No related branches found
No related tags found
No related merge requests found
......@@ -40,15 +40,17 @@ Client::set_server(const std::string &server)
void
Client::close(bool force)
{
// We close all open connections.
if (force) {
shutdown();
ios_.stop();
}
// Destroy work object. This allows the I/O thread to
// exit the event loop when there are no more pending
// asynchronous operations.
work_.reset();
// We close all open connections.
if (force)
shutdown();
// Wait for the worker threads to exit.
thread_group_.join_all();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment