Skip to content

Commit

Permalink
Comment on_connection_requeue_delayed
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Oct 6, 2021
1 parent 1e8c041 commit 6f0fba4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nano/node/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ void nano::server_socket::on_connection (std::function<bool (std::shared_ptr<nan
}));
}

// If we are unable to accept a socket, for any reason, we wait just a little (1ms) before rescheduling the next connection accept.
// The intention is to throttle back the connection requests and break up any busy loops that could possibly form and
// give the rest of the system a chance to recover.
void nano::server_socket::on_connection_requeue_delayed (std::function<bool (std::shared_ptr<nano::socket> const &, boost::system::error_code const &)> callback_a)
{
auto this_l (std::static_pointer_cast<nano::server_socket> (shared_from_this ()));
Expand Down

0 comments on commit 6f0fba4

Please sign in to comment.