AWS IoT Device SDK C++ v2
1.45.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
66
uint64_t
MinThroughputBytesPerSecond
;
67
uint32_t
AllowableThroughputFailureIntervalSeconds
;
68
};
69
73
class
AWS_CRT_CPP_API
HttpClientConnectionManager final
74
:
public
std::enable_shared_from_this<HttpClientConnectionManager>
75
{
76
public
:
77
~HttpClientConnectionManager();
78
89
bool
AcquireConnection
(
const
OnClientConnectionAvailable
&onClientConnectionAvailable)
noexcept
;
90
98
std::future<void>
InitiateShutdown
()
noexcept
;
99
107
static
std::shared_ptr<HttpClientConnectionManager>
NewClientConnectionManager
(
108
const
HttpClientConnectionManagerOptions
&connectionManagerOptions,
109
Allocator
*allocator =
ApiAllocator
())
noexcept
;
110
111
private
:
112
HttpClientConnectionManager(
113
const
HttpClientConnectionManagerOptions
&options,
114
Allocator
*allocator =
ApiAllocator
())
noexcept
;
115
116
Allocator
*m_allocator;
117
118
aws_http_connection_manager *m_connectionManager;
119
120
HttpClientConnectionManagerOptions
m_options;
121
std::promise<void> m_shutdownPromise;
122
std::atomic<bool> m_releaseInvoked;
123
124
static
void
s_onConnectionSetup(
125
aws_http_connection *connection,
126
int
errorCode,
127
void
*userData)
noexcept
;
128
129
static
void
s_shutdownCompleted(
void
*userData)
noexcept
;
130
131
friend
class
ManagedConnection
;
132
};
133
}
// namespace Http
134
}
// namespace Crt
135
}
// namespace Aws
HttpConnection.h
Aws::Crt::Http::HttpClientConnectionManager::InitiateShutdown
std::future< void > InitiateShutdown() noexcept
Definition
HttpConnectionManager.cpp:181
Aws::Crt::Http::HttpClientConnectionManager::AcquireConnection
bool AcquireConnection(const OnClientConnectionAvailable &onClientConnectionAvailable) noexcept
Definition
HttpConnectionManager.cpp:164
Aws::Crt::Http::HttpClientConnectionManager::NewClientConnectionManager
static std::shared_ptr< HttpClientConnectionManager > NewClientConnectionManager(const HttpClientConnectionManagerOptions &connectionManagerOptions, Allocator *allocator=ApiAllocator()) noexcept
Definition
HttpConnectionManager.cpp:39
Aws::Crt::Http::HttpClientConnectionManager::ManagedConnection
friend class ManagedConnection
Definition
HttpConnectionManager.h:131
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:33
Aws::Crt::Http::HttpClientConnectionManagerOptions::AllowableThroughputFailureIntervalSeconds
uint32_t AllowableThroughputFailureIntervalSeconds
Definition
HttpConnectionManager.h:67
Aws::Crt::Http::HttpClientConnectionManagerOptions::MaxConnections
size_t MaxConnections
Definition
HttpConnectionManager.h:50
Aws::Crt::Http::HttpClientConnectionManagerOptions::MinThroughputBytesPerSecond
uint64_t MinThroughputBytesPerSecond
Definition
HttpConnectionManager.h:66
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