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_client
appears to use anasio::io_service
that keeps running.To finish a HttpClient program use
asio::io_service::stop()
.To be able to access the
io_service
thathttp_client
uses:io_service
instance;http_client
viahttp_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.)