olp-cpp-sdk  1.19.0
Public Member Functions | List of all members
olp::http::NetworkSettings Class Referencefinal

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...
 
NetworkSettingsWithRetries (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...
 
NetworkSettingsWithConnectionTimeout (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...
 
NetworkSettingsWithMaxConnectionLifetime (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...
 
NetworkSettingsWithTransferTimeout (std::chrono::milliseconds timeout)
 Sets the transfer timeout. More...
 
const NetworkProxySettingsGetProxySettings () const
 Gets the proxy settings. More...
 
NetworkSettingsWithProxySettings (NetworkProxySettings settings)
 Sets the proxy settings. More...
 
const std::vector< std::string > & GetDNSServers () const
 Gets the DNS list. More...
 
NetworkSettingsWithDNSServers (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...
 

Detailed Description

Contains a configuration for the network.

Member Function Documentation

◆ GetConnectionTimeoutDuration()

std::chrono::milliseconds olp::http::NetworkSettings::GetConnectionTimeoutDuration ( ) const

Gets the connection timeout.

Returns
The connection timeout.

◆ GetDNSServers()

const std::vector<std::string>& olp::http::NetworkSettings::GetDNSServers ( ) const

Gets the DNS list.

Returns
The DNS list.

◆ GetMaxConnectionLifetime()

std::chrono::seconds olp::http::NetworkSettings::GetMaxConnectionLifetime ( ) const

Gets max lifetime (since creation) allowed for reusing a connection.

Returns
The lifetime.

◆ GetProxySettings()

const NetworkProxySettings& olp::http::NetworkSettings::GetProxySettings ( ) const

Gets the proxy settings.

Returns
The proxy settings.

◆ GetRetries()

std::size_t olp::http::NetworkSettings::GetRetries ( ) const

Gets the maximum number of retries for the HTTP request.

Returns
The maximum number of retries for the HTTP request.

◆ GetTransferTimeoutDuration()

std::chrono::milliseconds olp::http::NetworkSettings::GetTransferTimeoutDuration ( ) const

Gets the transfer timeout.

Returns
The transfer timeout.

◆ OLP_SDK_DEPRECATED() [1/4]

olp::http::NetworkSettings::OLP_SDK_DEPRECATED ( "Will be removed by 04.  2024,
use " "WithConnectionTimeout(std::chrono::milliseconds) instead"   
) &

Sets the connection timeout in seconds.

Parameters
[in]timeoutThe connection timeout in seconds.
Returns
A reference to *this.

◆ OLP_SDK_DEPRECATED() [2/4]

olp::http::NetworkSettings::OLP_SDK_DEPRECATED ( "Will be removed by 04.  2024,
use " "WithTransferTimeout(std::chrono::milliseconds) instead"   
) &

Sets the transfer timeout in seconds.

Parameters
[in]timeoutThe transfer timeout in seconds.
Returns
A reference to *this.

◆ OLP_SDK_DEPRECATED() [3/4]

olp::http::NetworkSettings::OLP_SDK_DEPRECATED ( "Will be removed by 04.  2024,
use GetConnectionTimeoutDuration() instead"   
) const

Gets the connection timeout in seconds.

Returns
The connection timeout in seconds.

◆ OLP_SDK_DEPRECATED() [4/4]

olp::http::NetworkSettings::OLP_SDK_DEPRECATED ( "Will be removed by 04.  2024,
use GetTransferTimeoutDuration() instead"   
) const

Gets the transfer timeout in seconds.

Returns
The transfer timeout in seconds.

◆ WithConnectionTimeout()

NetworkSettings& olp::http::NetworkSettings::WithConnectionTimeout ( std::chrono::milliseconds  timeout)

Sets the connection timeout.

Parameters
[in]timeoutThe connection timeout.
Returns
A reference to *this.

◆ WithDNSServers()

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.

Parameters
[in]dns_serversThe DNS list.
Returns
A reference to *this.

◆ WithMaxConnectionLifetime()

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.

Returns
A reference to *this.

◆ WithProxySettings()

NetworkSettings& olp::http::NetworkSettings::WithProxySettings ( NetworkProxySettings  settings)

Sets the proxy settings.

Parameters
[in]settingsThe proxy settings.
Returns
A reference to *this.

◆ WithRetries()

NetworkSettings& olp::http::NetworkSettings::WithRetries ( std::size_t  retries)

Sets the maximum number of retries for the HTTP request.

Parameters
[in]retriesThe maximum number of retries for HTTP request.
Returns
A reference to *this.

◆ WithTransferTimeout()

NetworkSettings& olp::http::NetworkSettings::WithTransferTimeout ( std::chrono::milliseconds  timeout)

Sets the transfer timeout.

Parameters
[in]timeoutThe transfer timeout.
Returns
A reference to *this.

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