Electroneum
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  }
bool connect(std::chrono::milliseconds timeout)
Definition: http_client.h:333
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  }
Here is the call graph for this function:

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()

static constexpr std::chrono::seconds tools::t_http_connection::TIMEOUT ( )
inlinestatic

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: