Electroneum
daemonize::t_p2p Class Referencefinal

#include <p2p.h>

Public Member Functions

 t_p2p (boost::program_options::variables_map const &vm, t_protocol &protocol)
 
t_node_serverget ()
 
void run ()
 
void stop ()
 
 ~t_p2p ()
 

Static Public Member Functions

static void init_options (boost::program_options::options_description &option_spec)
 

Detailed Description

Definition at line 44 of file p2p.h.

Constructor & Destructor Documentation

◆ t_p2p()

daemonize::t_p2p::t_p2p ( boost::program_options::variables_map const &  vm,
t_protocol protocol 
)
inline

Definition at line 57 of file p2p.h.

61  : m_server{protocol.get()}
62  {
63  //initialize objects
64  MGINFO("Initializing p2p server...");
65  if (!m_server.init(vm))
66  {
67  throw std::runtime_error("Failed to initialize p2p server.");
68  }
69  MGINFO("p2p server initialized OK");
70  }
#define MGINFO(x)
Definition: misc_log_ex.h:80
bool init(const boost::program_options::variables_map &vm)
Here is the call graph for this function:

◆ ~t_p2p()

daemonize::t_p2p::~t_p2p ( )
inline

Definition at line 89 of file p2p.h.

90  {
91  MGINFO("Deinitializing p2p...");
92  try {
93  m_server.deinit();
94  } catch (...) {
95  MERROR("Failed to deinitialize p2p...");
96  }
97  }
#define MERROR(x)
Definition: misc_log_ex.h:73
#define MGINFO(x)
Definition: misc_log_ex.h:80

Member Function Documentation

◆ get()

t_node_server& daemonize::t_p2p::get ( )
inline

Definition at line 72 of file p2p.h.

73  {
74  return m_server;
75  }
Here is the caller graph for this function:

◆ init_options()

static void daemonize::t_p2p::init_options ( boost::program_options::options_description &  option_spec)
inlinestatic

Definition at line 50 of file p2p.h.

51  {
52  t_node_server::init_options(option_spec);
53  }
static void init_options(boost::program_options::options_description &desc)
Here is the call graph for this function:

◆ run()

void daemonize::t_p2p::run ( )
inline

Definition at line 77 of file p2p.h.

78  {
79  MGINFO("Starting p2p net loop...");
80  m_server.run();
81  MGINFO("p2p net loop stopped");
82  }
#define MGINFO(x)
Definition: misc_log_ex.h:80

◆ stop()

void daemonize::t_p2p::stop ( )
inline

Definition at line 84 of file p2p.h.

85  {
86  m_server.send_stop_signal();
87  }

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