Skip to content

Commit

Permalink
ASYNC CONNECT
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Apr 1, 2024
1 parent 165f66c commit 30e430d
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 50 deletions.
7 changes: 7 additions & 0 deletions nano/lib/stats_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,18 @@ enum class detail : uint8_t
accept_error,
accept_failure,
accept_limits_exceeded,
attempts_limits_exceeded,
attempt_in_progress,
close_error,
max_per_ip,
max_per_subnetwork,
max_attempts,
excluded,
erase_dead,
connect_initiate,
connect_failure,
connect_error,
attempt_timeout,

// tcp_server
handshake,
Expand Down
2 changes: 2 additions & 0 deletions nano/node/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace nano
{
using endpoint = boost::asio::ip::udp::endpoint;
using tcp_endpoint = boost::asio::ip::tcp::endpoint;
using ip_address = boost::asio::ip::address;
using ip_port = uint16_t;

bool parse_port (std::string const &, uint16_t &);
bool parse_address (std::string const &, boost::asio::ip::address &);
Expand Down
2 changes: 0 additions & 2 deletions nano/node/transport/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,6 @@ void nano::transport::tcp_channels::purge (std::chrono::steady_clock::time_point
{
nano::lock_guard<nano::mutex> lock{ mutex };

node.logger.debug (nano::log::type::tcp_channels, "Performing periodic channel cleanup, cutoff: {}s", nano::log::seconds_delta (cutoff_deadline));

auto should_close = [this, cutoff_deadline] (auto const & channel) {
// Remove channels that haven't successfully sent a message within the cutoff time
if (auto last = channel->get_last_packet_sent (); last < cutoff_deadline)
Expand Down
Loading

0 comments on commit 30e430d

Please sign in to comment.