mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
* Added sync log to streamer. * Fixed ledger closing attempt while syncing. * Added diagnostic contract. * Reset to stage 0 on unreliable votes. * Reduced peer msg age threshold. * Added health tracking. * Weakly-connected detection improvement. * Increased version 0.5.1. * Improved client lib server version check. * Added health logging support to text client. * Added weakly connected status in status response. * Increased max peers limits when serializing. * Local docker cluster manual ip. * Updated vultr script vm region order. * Sync status reporting improvement. * Added milliseconds to logging.
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
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
|
|
{
|
|
struct peer_properties;
|
|
|
|
class peer_comm_server : public comm::comm_server<peer_comm_session>
|
|
{
|
|
private:
|
|
int custom_connection_invocations = -1;
|
|
std::thread peer_managing_thread; // Thread to manage peer connections.
|
|
uint16_t connected_status_check_counter = 0;
|
|
|
|
void maintain_known_connections();
|
|
void peer_managing_loop();
|
|
void detect_if_weakly_connected();
|
|
|
|
protected:
|
|
void start_custom_jobs();
|
|
void stop_custom_jobs();
|
|
int process_custom_messages();
|
|
|
|
public:
|
|
std::atomic<uint16_t> known_remote_count = 0;
|
|
std::mutex req_known_remotes_mutex;
|
|
std::vector<peer_properties> req_known_remotes;
|
|
peer_comm_server(const uint16_t port, const uint64_t (&metric_thresholds)[5], const uint64_t max_msg_size,
|
|
const uint64_t max_in_connections, const uint64_t max_in_connections_per_host,
|
|
const std::vector<peer_properties> &req_known_remotes);
|
|
};
|
|
} // namespace p2p
|
|
|
|
#endif |