olp-cpp-sdk
1.19.0
|
Contains a configuration for the network. More...
#include <NetworkSettings.h>
Public Member Functions | |
std::size_t | GetRetries () const |
Gets the maximum number of retries for the HTTP request. More... | |
NetworkSettings & | WithRetries (std::size_t retries) |
Sets the maximum number of retries for the HTTP request. More... | |
OLP_SDK_DEPRECATED ("Will be removed by 04.2024, use GetConnectionTimeoutDuration() instead") int GetConnectionTimeout() const | |
Gets the connection timeout in seconds. More... | |
std::chrono::milliseconds | GetConnectionTimeoutDuration () const |
Gets the connection timeout. More... | |
OLP_SDK_DEPRECATED ("Will be removed by 04.2024, use " "WithConnectionTimeout(std::chrono::milliseconds) instead") NetworkSettings &WithConnectionTimeout(int timeout) | |
Sets the connection timeout in seconds. More... | |
NetworkSettings & | WithConnectionTimeout (std::chrono::milliseconds timeout) |
Sets the connection timeout. More... | |
OLP_SDK_DEPRECATED ("Will be removed by 04.2024, use GetTransferTimeoutDuration() instead") int GetTransferTimeout() const | |
Gets the transfer timeout in seconds. More... | |
std::chrono::milliseconds | GetTransferTimeoutDuration () const |
Gets the transfer timeout. More... | |
OLP_SDK_DEPRECATED ("Will be removed by 04.2024, use " "WithTransferTimeout(std::chrono::milliseconds) instead") NetworkSettings &WithTransferTimeout(int timeout) | |
Sets the transfer timeout in seconds. More... | |
std::chrono::seconds | GetMaxConnectionLifetime () const |
Gets max lifetime (since creation) allowed for reusing a connection. More... | |
NetworkSettings & | WithMaxConnectionLifetime (std::chrono::seconds lifetime) |
Sets max lifetime (since creation) allowed for reusing a connection. Supported only for CURL implementation. If set to 0, this behavior is disabled: all connections are eligible for reuse. More... | |
NetworkSettings & | WithTransferTimeout (std::chrono::milliseconds timeout) |
Sets the transfer timeout. More... | |
const NetworkProxySettings & | GetProxySettings () const |
Gets the proxy settings. More... | |
NetworkSettings & | WithProxySettings (NetworkProxySettings settings) |
Sets the proxy settings. More... | |
const std::vector< std::string > & | GetDNSServers () const |
Gets the DNS list. More... | |
NetworkSettings & | WithDNSServers (std::vector< std::string > dns_servers) |
Sets the DNS servers to use. Works only with CURL implementation. The order is important.To reduce response time make sure that most probably servers are at the beginning. More... | |
Contains a configuration for the network.
std::chrono::milliseconds olp::http::NetworkSettings::GetConnectionTimeoutDuration | ( | ) | const |
Gets the connection timeout.
const std::vector<std::string>& olp::http::NetworkSettings::GetDNSServers | ( | ) | const |
Gets the DNS list.
std::chrono::seconds olp::http::NetworkSettings::GetMaxConnectionLifetime | ( | ) | const |
Gets max lifetime (since creation) allowed for reusing a connection.
const NetworkProxySettings& olp::http::NetworkSettings::GetProxySettings | ( | ) | const |
Gets the proxy settings.
std::size_t olp::http::NetworkSettings::GetRetries | ( | ) | const |
Gets the maximum number of retries for the HTTP request.
std::chrono::milliseconds olp::http::NetworkSettings::GetTransferTimeoutDuration | ( | ) | const |
Gets the transfer timeout.
olp::http::NetworkSettings::OLP_SDK_DEPRECATED | ( | "Will be removed by 04. | 2024, |
use " "WithConnectionTimeout(std::chrono::milliseconds) instead" | |||
) | & |
Sets the connection timeout in seconds.
[in] | timeout | The connection timeout in seconds. |
olp::http::NetworkSettings::OLP_SDK_DEPRECATED | ( | "Will be removed by 04. | 2024, |
use " "WithTransferTimeout(std::chrono::milliseconds) instead" | |||
) | & |
Sets the transfer timeout in seconds.
[in] | timeout | The transfer timeout in seconds. |
olp::http::NetworkSettings::OLP_SDK_DEPRECATED | ( | "Will be removed by 04. | 2024, |
use GetConnectionTimeoutDuration() instead" | |||
) | const |
Gets the connection timeout in seconds.
olp::http::NetworkSettings::OLP_SDK_DEPRECATED | ( | "Will be removed by 04. | 2024, |
use GetTransferTimeoutDuration() instead" | |||
) | const |
Gets the transfer timeout in seconds.
NetworkSettings& olp::http::NetworkSettings::WithConnectionTimeout | ( | std::chrono::milliseconds | timeout | ) |
Sets the connection timeout.
[in] | timeout | The connection timeout. |
NetworkSettings& olp::http::NetworkSettings::WithDNSServers | ( | std::vector< std::string > | dns_servers | ) |
Sets the DNS servers to use. Works only with CURL implementation. The order is important.To reduce response time make sure that most probably servers are at the beginning.
Note: This list replaces any other mechanism to retrieve DNS list.
[in] | dns_servers | The DNS list. |
NetworkSettings& olp::http::NetworkSettings::WithMaxConnectionLifetime | ( | std::chrono::seconds | lifetime | ) |
Sets max lifetime (since creation) allowed for reusing a connection. Supported only for CURL implementation. If set to 0, this behavior is disabled: all connections are eligible for reuse.
NetworkSettings& olp::http::NetworkSettings::WithProxySettings | ( | NetworkProxySettings | settings | ) |
Sets the proxy settings.
[in] | settings | The proxy settings. |
NetworkSettings& olp::http::NetworkSettings::WithRetries | ( | std::size_t | retries | ) |
Sets the maximum number of retries for the HTTP request.
[in] | retries | The maximum number of retries for HTTP request. |
NetworkSettings& olp::http::NetworkSettings::WithTransferTimeout | ( | std::chrono::milliseconds | timeout | ) |
Sets the transfer timeout.
[in] | timeout | The transfer timeout. |