aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
HttpConnectionManager.h
Go to the documentation of this file.
1#pragma once
7
8#include <atomic>
9#include <condition_variable>
10#include <future>
11#include <mutex>
12
13struct aws_http_connection_manager;
14
15namespace Aws
16{
17 namespace Crt
18 {
19 namespace Http
20 {
27 std::function<void(std::shared_ptr<HttpClientConnection>, int errorCode)>;
28
69
74 : public std::enable_shared_from_this<HttpClientConnectionManager>
75 {
76 public:
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:
114 Allocator *allocator = ApiAllocator()) noexcept;
115
116 Allocator *m_allocator;
117
118 aws_http_connection_manager *m_connectionManager;
119
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
#define AWS_CRT_CPP_API
Definition Exports.h:36
Definition HttpConnectionManager.h:75
Definition HttpConnectionManager.h:33
HttpClientConnectionManagerOptions & operator=(const HttpClientConnectionManagerOptions &rhs)=default
HttpClientConnectionOptions ConnectionOptions
Definition HttpConnectionManager.h:45
uint32_t AllowableThroughputFailureIntervalSeconds
Definition HttpConnectionManager.h:67
size_t MaxConnections
Definition HttpConnectionManager.h:50
uint64_t MinThroughputBytesPerSecond
Definition HttpConnectionManager.h:66
HttpClientConnectionManagerOptions & operator=(HttpClientConnectionManagerOptions &&rhs)=default
HttpClientConnectionManagerOptions(HttpClientConnectionManagerOptions &&rhs)=default
bool EnableBlockingShutdown
Definition HttpConnectionManager.h:59
HttpClientConnectionManagerOptions(const HttpClientConnectionManagerOptions &rhs)=default
Definition HttpConnection.h:442
Definition HttpConnectionManager.cpp:189
std::function< void(std::shared_ptr< HttpClientConnection >, int errorCode)> OnClientConnectionAvailable
Definition HttpConnectionManager.h:27
aws_allocator Allocator
Definition Allocator.h:14
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
Definition Allocator.h:11