AWS SDK for C++
AWS SDK for C++
Loading...
Searching...
No Matches
CurlHandleContainer.h
Go to the documentation of this file.
1
6#pragma once
7
9
10#include <utility>
11#include <curl/curl.h>
12
13namespace Aws
14{
15namespace Http
16{
17
25{
26public:
31 CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true,
32 unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1);
34
43 void ReleaseCurlHandle(CURL* handle);
44
48 void DestroyCurlHandle(CURL* handle);
49
50private:
52 const CurlHandleContainer& operator = (const CurlHandleContainer&) = delete;
54 const CurlHandleContainer& operator = (const CurlHandleContainer&&) = delete;
55
56 CURL* CreateCurlHandleInPool();
57 bool CheckAndGrowPool();
58 void SetDefaultOptionsOnHandle(CURL* handle);
59
61 unsigned m_maxPoolSize;
62 unsigned long m_httpRequestTimeout;
63 unsigned long m_connectTimeout;
64 bool m_enableTcpKeepAlive;
65 unsigned long m_tcpKeepAliveIntervalMs;
66 unsigned long m_lowSpeedTime;
67 unsigned long m_lowSpeedLimit;
68 unsigned m_poolSize;
69 std::mutex m_containerLock;
70};
71
72} // namespace Http
73} // namespace Aws
74
CurlHandleContainer(unsigned maxSize=50, long httpRequestTimeout=0, long connectTimeout=1000, bool tcpKeepAlive=true, unsigned long tcpKeepAliveIntervalMs=30000, long lowSpeedTime=3000, unsigned long lowSpeedLimit=1)
void ReleaseCurlHandle(CURL *handle)
void DestroyCurlHandle(CURL *handle)