The "better" fix for this file is to wrap all the operations that can throw an exception (dealing with the http_client::response object) in try {...} catch {...} blocks. Can you try that instead of this complication with io_service?