AWS IoT Device SDK C++ v2
1.44.1
AWS IoT Device SDK C++ v2
Toggle main menu visibility
Loading...
Searching...
No Matches
crt
aws-crt-cpp
include
aws
crt
http
HttpConnectionManager.h
Go to the documentation of this file.
1
#pragma once
6
#include <
aws/crt/http/HttpConnection.h
>
7
8
#include <atomic>
9
#include <condition_variable>
10
#include <future>
11
#include <mutex>
12
13
struct
aws_http_connection_manager;
14
15
namespace
Aws
16
{
17
namespace
Crt
18
{
19
namespace
Http
20
{
26
using
OnClientConnectionAvailable
=
27
std::function<void(std::shared_ptr<HttpClientConnection>,
int
errorCode)>;
28
32
class
AWS_CRT_CPP_API
HttpClientConnectionManagerOptions
33
{
34
public
:
35
HttpClientConnectionManagerOptions
()
noexcept
;
36
HttpClientConnectionManagerOptions
(
const
HttpClientConnectionManagerOptions
&rhs) =
default
;
37
HttpClientConnectionManagerOptions
(
HttpClientConnectionManagerOptions
&&rhs) =
default
;
38
39
HttpClientConnectionManagerOptions
&
operator=
(
const
HttpClientConnectionManagerOptions
&rhs) =
default
;
40
HttpClientConnectionManagerOptions
&
operator=
(
HttpClientConnectionManagerOptions
&&rhs) =
default
;
41
45
HttpClientConnectionOptions
ConnectionOptions
;
46
50
size_t
MaxConnections
;
51
59
bool
EnableBlockingShutdown
;
60
};
61
65
class
AWS_CRT_CPP_API
HttpClientConnectionManager final
66
:
public
std::enable_shared_from_this<HttpClientConnectionManager>
67
{
68
public
:
69
~HttpClientConnectionManager();
70
81
bool
AcquireConnection
(
const
OnClientConnectionAvailable
&onClientConnectionAvailable)
noexcept
;
82
90
std::future<void>
InitiateShutdown
()
noexcept
;
91
99
static
std::shared_ptr<HttpClientConnectionManager>
NewClientConnectionManager
(
100
const
HttpClientConnectionManagerOptions
&connectionManagerOptions,
101
Allocator
*allocator =
ApiAllocator
())
noexcept
;
102
103
private
:
104
HttpClientConnectionManager(
105
const
HttpClientConnectionManagerOptions
&options,
106
Allocator
*allocator =
ApiAllocator
())
noexcept
;
107
108
Allocator
*m_allocator;
109
110
aws_http_connection_manager *m_connectionManager;
111
112
HttpClientConnectionManagerOptions
m_options;
113
std::promise<void> m_shutdownPromise;
114
std::atomic<bool> m_releaseInvoked;
115
116
static
void
s_onConnectionSetup(
117
aws_http_connection *connection,
118
int
errorCode,
119
void
*userData)
noexcept
;
120
121
static
void
s_shutdownCompleted(
void
*userData)
noexcept
;
122
123
friend
class
ManagedConnection
;
124
};
125
}
// namespace Http
126
}
// namespace Crt
127
}
// namespace Aws
HttpConnection.h
Aws::Crt::Http::HttpClientConnectionManager::InitiateShutdown
std::future< void > InitiateShutdown() noexcept
Definition
HttpConnectionManager.cpp:169
Aws::Crt::Http::HttpClientConnectionManager::AcquireConnection
bool AcquireConnection(const OnClientConnectionAvailable &onClientConnectionAvailable) noexcept
Definition
HttpConnectionManager.cpp:152
Aws::Crt::Http::HttpClientConnectionManager::NewClientConnectionManager
static std::shared_ptr< HttpClientConnectionManager > NewClientConnectionManager(const HttpClientConnectionManagerOptions &connectionManagerOptions, Allocator *allocator=ApiAllocator()) noexcept
Definition
HttpConnectionManager.cpp:37
Aws::Crt::Http::HttpClientConnectionManager::ManagedConnection
friend class ManagedConnection
Definition
HttpConnectionManager.h:123
Aws::Crt::Http::HttpClientConnectionManagerOptions
Definition
HttpConnectionManager.h:33
Aws::Crt::Http::HttpClientConnectionManagerOptions::operator=
HttpClientConnectionManagerOptions & operator=(const HttpClientConnectionManagerOptions &rhs)=default
Aws::Crt::Http::HttpClientConnectionManagerOptions::ConnectionOptions
HttpClientConnectionOptions ConnectionOptions
Definition
HttpConnectionManager.h:45
Aws::Crt::Http::HttpClientConnectionManagerOptions::HttpClientConnectionManagerOptions
HttpClientConnectionManagerOptions() noexcept
Definition
HttpConnectionManager.cpp:32
Aws::Crt::Http::HttpClientConnectionManagerOptions::MaxConnections
size_t MaxConnections
Definition
HttpConnectionManager.h:50
Aws::Crt::Http::HttpClientConnectionManagerOptions::operator=
HttpClientConnectionManagerOptions & operator=(HttpClientConnectionManagerOptions &&rhs)=default
Aws::Crt::Http::HttpClientConnectionManagerOptions::HttpClientConnectionManagerOptions
HttpClientConnectionManagerOptions(HttpClientConnectionManagerOptions &&rhs)=default
Aws::Crt::Http::HttpClientConnectionManagerOptions::EnableBlockingShutdown
bool EnableBlockingShutdown
Definition
HttpConnectionManager.h:59
Aws::Crt::Http::HttpClientConnectionManagerOptions::HttpClientConnectionManagerOptions
HttpClientConnectionManagerOptions(const HttpClientConnectionManagerOptions &rhs)=default
Aws::Crt::Http::HttpClientConnectionOptions
Definition
HttpConnection.h:442
AWS_CRT_CPP_API
#define AWS_CRT_CPP_API
Definition
Exports.h:36
Aws::Crt::Http
Definition
Credentials.h:28
Aws::Crt::Http::OnClientConnectionAvailable
std::function< void(std::shared_ptr< HttpClientConnection >, int errorCode)> OnClientConnectionAvailable
Definition
HttpConnectionManager.h:26
Aws::Crt
Definition
Allocator.h:13
Aws::Crt::ApiAllocator
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition
Allocator.cpp:24
Aws::Crt::Allocator
aws_allocator Allocator
Definition
Allocator.h:14
Aws
Definition
Allocator.h:11
Generated by
1.17.0