#include <LibcurlHTTP2Connection.h>
◆ ActiveStreamMap
Alias for c++ ordered map where key is curl handle and value is pointer to LibcurlHTTP2Request.
◆ ~LibcurlHTTP2Connection()
alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::~LibcurlHTTP2Connection |
( |
| ) |
|
◆ LibcurlHTTP2Connection()
alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::LibcurlHTTP2Connection |
( |
const std::shared_ptr< LibcurlSetCurlOptionsCallbackInterface > & |
setCurlOptionsCallback = nullptr | ) |
|
|
protected |
◆ addObserver()
◆ addStream()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::addStream |
( |
std::shared_ptr< LibcurlHTTP2Request > |
stream | ) |
|
|
protected |
Adds a configured stream into this connection.
- Parameters
-
stream | Request object with a configured curl handle. |
- Returns
libcurl
code indicating the result of this operation.
◆ areStreamsPaused()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::areStreamsPaused |
( |
| ) |
|
|
protected |
Determine whether all non-intermittent streams are paused. An intermittent stream would be a persistent downchannel stream, for instace.
- Returns
- True if all non-intermittent streams are paused, false otherwise.
◆ cancelActiveStream()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cancelActiveStream |
( |
ActiveStreamMap::iterator & |
iterator | ) |
|
|
protected |
Cancel an active stream and report CANCELLED completion status.
- Parameters
-
[in,out] | iterator | The iterator to ActiveStreamMap to erase. |
- Returns
- Whether the operation was successful.
◆ cancelActiveStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cancelActiveStreams |
( |
| ) |
|
|
protected |
Release any active streams and report CANCELLED completion status.
◆ cancelAllStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cancelAllStreams |
( |
| ) |
|
|
protected |
Cancels all streams on cleanup.
◆ cancelPendingStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cancelPendingStreams |
( |
| ) |
|
|
protected |
Report CANCELLED completion status on any pending streams in the queue.
◆ cleanupCancelledAndStalledStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cleanupCancelledAndStalledStreams |
( |
| ) |
|
|
protected |
Checks for streams that have been cancelled, removes them, and reports CANCELLED completion status. Checks for streams that have not progressed within their timeout, removes them, and reports the response code (if any) and completion status (TIMEOUT).
◆ cleanupFinishedStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::cleanupFinishedStreams |
( |
| ) |
|
|
protected |
Checks if any active streams have finished and reports the response code and completion status for them.
◆ create()
◆ createAndSendRequest()
◆ createMultiHandle()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::createMultiHandle |
( |
| ) |
|
|
protected |
Set up the multi-handle. Re-assign a new multi-handle, if m_multi is already non-null.
- Returns
- true if successful, false if a failure was encountered
◆ dequeueRequest()
std::shared_ptr<LibcurlHTTP2Request> alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::dequeueRequest |
( |
| ) |
|
|
protected |
Take the next request from the queue;
- Returns
- next request, or nullPtr if queue is empty or the network loop is stopping.
◆ disconnect()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::disconnect |
( |
| ) |
|
|
overridevirtual |
◆ isStopping()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::isStopping |
( |
| ) |
|
|
protected |
Find out whether or not the network loop is stopping.
- Returns
- Whether or not the network loop is stopping.
◆ networkLoop()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::networkLoop |
( |
| ) |
|
|
protected |
Main network loop. Repeatedly call curl_multi_perform in order to transfer data on the incorporated streams.
◆ notifyObserversOfGoawayReceived()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::notifyObserversOfGoawayReceived |
( |
| ) |
|
|
protected |
Notify observers that a GOAWAY frame has been received.
◆ processNextRequest()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::processNextRequest |
( |
| ) |
|
|
protected |
Dequeue next request and add it to the multi-handle
◆ releaseStream()
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::releaseStream |
( |
ActiveStreamMap::iterator & |
iterator | ) |
|
|
protected |
Release a stream.
- Parameters
-
[in,out] | iterator | The iterator to ActiveStreamMap to erase. |
- Returns
- Whether the operation was successful.
◆ removeObserver()
◆ setIsStopping()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::setIsStopping |
( |
| ) |
|
|
protected |
Safely set m_isStopping to break out of the network loop.
◆ unPauseActiveStreams()
void alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::unPauseActiveStreams |
( |
| ) |
|
|
protected |
UnPause all the active streams.
◆ m_activeStreams
ActiveStreamMap alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_activeStreams |
|
protected |
The list of streams that either do not have HTTP response headers, or have outstanding response data. Only accessed from the network loop thread.
◆ m_cv
std::condition_variable alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_cv |
|
protected |
Used to notify the network loop thread that there is at least one request queued or that the loop has been instructed to stop.
◆ m_isStopping
bool alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_isStopping |
|
protected |
Set to true when we want to exit the network loop.
◆ m_multi
Represents a CURL multi handle. Intended to only be accessed by the network loop thread and in addStream
.
◆ m_mutex
std::mutex alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_mutex |
|
protected |
Serializes concurrent access to the m_requestQueue and m_isStopping members.
◆ m_networkThread
std::thread alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_networkThread |
|
protected |
Main thread for this class.
◆ m_observers
◆ m_observersMutex
std::mutex alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_observersMutex |
|
protected |
◆ m_requestQueue
std::deque<std::shared_ptr<LibcurlHTTP2Request> > alexaClientSDK::avsCommon::utils::libcurlUtils::LibcurlHTTP2Connection::m_requestQueue |
|
protected |
Queue of requests send. Serialized by m_mutex
.
◆ m_setCurlOptionsCallback
The documentation for this class was generated from the following file:
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0