Electroneum
Loading...
Searching...
No Matches
tools::t_http_connection Class Reference

#include <http_connection.h>

Public Member Functions

 t_http_connection (epee::net_utils::http::http_simple_client *p_http_client)
 ~t_http_connection ()
bool is_open () const

Static Public Member Functions

static constexpr std::chrono::seconds TIMEOUT ()

Detailed Description

Definition at line 38 of file http_connection.h.

Constructor & Destructor Documentation

◆ t_http_connection()

tools::t_http_connection::t_http_connection ( epee::net_utils::http::http_simple_client * p_http_client)
inline

Definition at line 48 of file http_connection.h.

49 : mp_http_client(p_http_client)
50 , m_ok(false)
51 {
52 m_ok = mp_http_client->connect(TIMEOUT());
53 }
static constexpr std::chrono::seconds TIMEOUT()
Here is the call graph for this function:

◆ ~t_http_connection()

tools::t_http_connection::~t_http_connection ( )
inline

Definition at line 55 of file http_connection.h.

56 {
57 if (m_ok)
58 {
59 try { mp_http_client->disconnect(); }
60 catch (...) { /* do not propagate through dtor */ }
61 }
62 }

Member Function Documentation

◆ is_open()

bool tools::t_http_connection::is_open ( ) const
inline

Definition at line 64 of file http_connection.h.

65 {
66 return m_ok;
67 }

◆ TIMEOUT()

constexpr std::chrono::seconds tools::t_http_connection::TIMEOUT ( )
inlinestaticconstexpr

Definition at line 43 of file http_connection.h.

44 {
45 return std::chrono::minutes(3) + std::chrono::seconds(30);
46 }
Here is the caller graph for this function:

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/common/http_connection.h