AWS SDK for C++  1.9.109
AWS SDK for C++
Public Member Functions | List of all members
Aws::Http::CurlHandleContainer Class Reference

#include <CurlHandleContainer.h>

Public Member Functions

 CurlHandleContainer (unsigned maxSize=50, long httpRequestTimeout=0, long connectTimeout=1000, bool tcpKeepAlive=true, unsigned long tcpKeepAliveIntervalMs=30000, long lowSpeedTime=3000, unsigned long lowSpeedLimit=1)
 
 ~CurlHandleContainer ()
 
CURL * AcquireCurlHandle ()
 
void ReleaseCurlHandle (CURL *handle)
 
void DestroyCurlHandle (CURL *handle)
 

Detailed Description

Simple Connection pool manager for Curl. It maintains connections in a thread safe manner. You can call into acquire a handle, then put it back when finished. It is assumed that reusing an already initialized handle is preferable (especially for synchronous clients). The pool doubles in capacity as needed up to the maximum amount of connections.

Definition at line 24 of file CurlHandleContainer.h.

Constructor & Destructor Documentation

◆ CurlHandleContainer()

Aws::Http::CurlHandleContainer::CurlHandleContainer ( unsigned  maxSize = 50,
long  httpRequestTimeout = 0,
long  connectTimeout = 1000,
bool  tcpKeepAlive = true,
unsigned long  tcpKeepAliveIntervalMs = 30000,
long  lowSpeedTime = 3000,
unsigned long  lowSpeedLimit = 1 
)

Initializes an empty stack of CURL handles. If you are only making synchronous calls via your http client then a small size is best. For async support, a good value would be 6 * number of Processors. *

◆ ~CurlHandleContainer()

Aws::Http::CurlHandleContainer::~CurlHandleContainer ( )

Member Function Documentation

◆ AcquireCurlHandle()

CURL* Aws::Http::CurlHandleContainer::AcquireCurlHandle ( )

Blocks until a curl handle from the pool is available for use.

◆ DestroyCurlHandle()

void Aws::Http::CurlHandleContainer::DestroyCurlHandle ( CURL *  handle)

When the handle has bad DNS entries, problematic live connections, we need to destory the handle from pool.

◆ ReleaseCurlHandle()

void Aws::Http::CurlHandleContainer::ReleaseCurlHandle ( CURL *  handle)

Returns a handle to the pool for reuse. It is imperative that this is called after you are finished with the handle.


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