Files
hpcore/src/p2p/peer_comm_server.hpp
Ravin Perera 3ea0299964 Comm session re-architecture and self comm channel. (#145)
* Introduced self comm channel instead of loopback websocket.
* Introduced comm_session and comm_server inheritance hierarchy.
* Separated peer session and user session classes.
2020-11-08 22:14:08 +05:30

29 lines
890 B
C++

#ifndef _HP_P2P_PEER_COMM_SERVER_
#define _HP_P2P_PEER_COMM_SERVER_
#include "../comm/comm_server.hpp"
#include "peer_comm_session.hpp"
namespace p2p
{
class peer_comm_server : public comm::comm_server<peer_comm_session>
{
private:
const std::set<conf::ip_port_pair> &req_known_remotes;
int custom_connection_invocations = -1;
// std::thread known_peers_thread; // Known peers connection establishment thread.
void maintain_known_connections();
protected:
void start_custom_jobs();
void stop_custom_jobs();
int process_custom_messages();
void custom_connections();
public:
peer_comm_server(const uint16_t port, const uint64_t (&metric_thresholds)[4],
const uint64_t max_msg_size, const std::set<conf::ip_port_pair> &req_known_remotes);
};
} // namespace p2p
#endif