AWS IoT Device SDK C++ v2: Aws::Crt::Http::HttpClientConnectionManager Class Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Public Member Functions | Static Public Member Functions | Friends | List of all members
Aws::Crt::Http::HttpClientConnectionManager Class Referencefinal

`#include <HttpConnectionManager.h>`

Inheritance diagram for Aws::Crt::Http::HttpClientConnectionManager:

## Public Member Functions
| ~HttpClientConnectionManager ()
bool | AcquireConnection (const OnClientConnectionAvailable &onClientConnectionAvailable) noexcept
std::future< void > | InitiateShutdown () noexcept

## Static Public Member Functions
static std::shared_ptr< HttpClientConnectionManager > | NewClientConnectionManager (const HttpClientConnectionManagerOptions &connectionManagerOptions, Allocator *allocator=g_allocator) noexcept

## Friends
class | ManagedConnection

## Detailed Description

Manages a pool of connections to a specific endpoint using the same socket and tls options.

## Constructor & Destructor Documentation

## ◆ ~HttpClientConnectionManager()

Aws::Crt::Http::HttpClientConnectionManager::~HttpClientConnectionManager | ( |  | ) |

## Member Function Documentation

## ◆ AcquireConnection()

bool Aws::Crt::Http::HttpClientConnectionManager::AcquireConnection | ( | const OnClientConnectionAvailable & | onClientConnectionAvailable | ) |
| noexcept

Acquires a connection from the pool. onClientConnectionAvailable will be invoked upon an available connection. Returns true if the connection request was successfully queued, returns false if it failed. On failure, onClientConnectionAvailable will not be invoked. After receiving a connection, it will automatically be cleaned up when your last reference to the shared_ptr is released.

Parameters

  onClientConnectionAvailable | callback to invoke when a connection becomes available or the acquisition attempt terminates

Returns
  true if the acquisition was successfully kicked off, false otherwise (no callback)

## ◆ InitiateShutdown()

std::future< void > Aws::Crt::Http::HttpClientConnectionManager::InitiateShutdown | ( |  | ) |
| noexcept

Starts shutdown of the connection manager. Returns a future to the connection manager's shutdown process. If EnableBlockingDestruct was enabled on the connection manager options, calling get() on the returned future will block until the last connection is released. If the option is not set, get() will immediately return.

Returns
  future which will complete when shutdown has completed

## ◆ NewClientConnectionManager()

std::shared_ptr< HttpClientConnectionManager > Aws::Crt::Http::HttpClientConnectionManager::NewClientConnectionManager | ( | const HttpClientConnectionManagerOptions & | connectionManagerOptions,
|  | Allocator * | allocator = `g_allocator`
| ) |  |
| staticnoexcept

Factory function for connection managers

Parameters

  connectionManagerOptions | connection manager configuration data
  allocator | allocator to use

Returns
  a new connection manager instance

## Friends And Related Function Documentation

## ◆ ManagedConnection

friend class ManagedConnection
| friend

The documentation for this class was generated from the following files:

- crt/aws-crt-cpp/include/aws/crt/http/HttpConnectionManager.h
- crt/aws-crt-cpp/source/http/HttpConnectionManager.cpp