Transition asio::deadline_timer to asio::steady_timer

This commit is contained in:
Lee *!* Clagett
2026-03-19 23:27:22 +01:00
committed by t1amak
parent cc091c799a
commit 1faceec415
20 changed files with 119 additions and 79 deletions

View File

@@ -230,7 +230,7 @@ namespace nodetool
m_config.m_net_config.packet_max_size = P2P_DEFAULT_PACKET_MAX_SIZE;
m_config.m_net_config.config_id = 0;
m_config.m_net_config.connection_timeout = P2P_DEFAULT_CONNECTION_TIMEOUT;
m_config.m_net_config.ping_connection_timeout = P2P_DEFAULT_PING_CONNECTION_TIMEOUT;
m_config.m_net_config.ping_connection_timeout = std::chrono::milliseconds{P2P_DEFAULT_PING_CONNECTION_TIMEOUT};
m_config.m_net_config.send_peerlist_sz = P2P_DEFAULT_PEERS_IN_HANDSHAKE;
m_config.m_support_flags = 0; // only set in public zone
}

View File

@@ -975,7 +975,7 @@ namespace nodetool
for (auto& zone : m_network_zones)
{
zone.second.m_net_server.get_config_object().set_handler(this);
zone.second.m_net_server.get_config_object().m_invoke_timeout = P2P_DEFAULT_INVOKE_TIMEOUT;
zone.second.m_net_server.get_config_object().m_invoke_timeout = std::chrono::milliseconds{P2P_DEFAULT_INVOKE_TIMEOUT};
if (!zone.second.m_bind_ip.empty())
{
@@ -1060,8 +1060,8 @@ namespace nodetool
})); // lambda
network_zone& public_zone = m_network_zones.at(epee::net_utils::zone::public_);
public_zone.m_net_server.add_idle_handler(boost::bind(&node_server<t_payload_net_handler>::idle_worker, this), 1000);
public_zone.m_net_server.add_idle_handler(boost::bind(&t_payload_net_handler::on_idle, &m_payload_handler), 1000);
public_zone.m_net_server.add_idle_handler(boost::bind(&node_server<t_payload_net_handler>::idle_worker, this), std::chrono::seconds{1});
public_zone.m_net_server.add_idle_handler(boost::bind(&t_payload_net_handler::on_idle, &m_payload_handler), std::chrono::seconds{1});
//here you can set worker threads count
int thrds_count = 10;
@@ -1221,7 +1221,7 @@ namespace nodetool
LOG_DEBUG_CC(context, " COMMAND_HANDSHAKE(AND CLOSE) INVOKED OK");
}
context_ = context;
}, P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT);
}, std::chrono::milliseconds{P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT});
if(r)
{
@@ -2543,7 +2543,7 @@ namespace nodetool
f(context_, rsp.support_flags);
},
P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT
std::chrono::milliseconds{P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT}
);
return r;

View File

@@ -167,10 +167,10 @@ namespace nodetool
KV_SERIALIZE(config_id)
END_KV_SERIALIZE_MAP()
std::chrono::milliseconds ping_connection_timeout;
uint32_t max_out_connection_count;
uint32_t max_in_connection_count;
uint32_t connection_timeout;
uint32_t ping_connection_timeout;
uint32_t handshake_interval;
uint32_t packet_max_size;
uint32_t config_id;