When running the Cpp-netlib (version 0.11-rc1) [edit (addition)] code copied from [/edit] HttpClient example does not finish.
I assume it's because the connection is left open. 1. Is my assumption correct? 2. Does the connection have to be closed manually? 3. If so, how can the connection be accessed?
The Cpp-netlib
http_clientappears to use anasio::io_servicethat keeps running.To finish a HttpClient program use
asio::io_service::stop().To be able to access the
io_servicethathttp_clientuses:io_serviceinstance;http_clientviahttp_client_options; andstop()on theio_service-instance.The cppnetlib example client becomes:
(see https://github.com/kaspervandenberg/https-tryout/blob/e8a918c5aa8efaaff3a37ac339bf68d132c6d2d6/httpClient.cxx for a full example.)