olp-cpp-sdk  1.21.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::chrono::milliseconds GetConnectionTimeoutDuration () const
 Gets the connection timeout. More...
 
NetworkSettingsWithConnectionTimeout (std::chrono::milliseconds timeout)
 Sets the connection timeout. More...
 
std::chrono::milliseconds GetTransferTimeoutDuration () const
 Gets the transfer timeout. 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.

◆ GetTransferTimeoutDuration()

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

Gets the transfer timeout.

Returns
The transfer timeout.

◆ 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.

◆ 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: