7 #include <boost/asio/ssl/context.hpp> 32 using ClientHandle = std::unique_ptr<HttpsClient, HandleGuard>;
34 HttpsClientPool(
const std::string& domain, ::boost::asio::ssl::context* ssl_ctx,
48 void set_connect_timeout(
unsigned msec) { connect_msec_ = msec; }
53 IoContext& io_context() {
return io_cntx_; }
58 const std::string domain()
const {
return domain_; }
61 using SslContext = ::boost::asio::ssl::context;
63 SslContext& ssl_cntx_;
66 unsigned connect_msec_ = 1000, retry_cnt_ = 1;
67 int existing_handles_ = 0;
69 std::deque<HttpsClient*> available_handles_;
void set_retry_count(uint32_t cnt)
Sets number of retries for https client handles.
unsigned handles_count() const
Number of existing handles created by this pool.
ClientHandle GetHandle()
Returns https client connection from the pool.