-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respond to keepalive messages within a TCP socket #1742
Conversation
std::unique_ptr<nano::keepalive> request (new nano::keepalive (error, stream, header_a)); | ||
if (!error) | ||
{ | ||
add_request (std::unique_ptr<nano::message> (request.release ())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this just be: add_request (std::move (request));
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a lot of these need to be fixed to use c++13 semantics.
}); | ||
|
||
auto output (keepalive.to_bytes ()); | ||
bool done (false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should be atomic ?
{ | ||
BOOST_LOG (connection->node->log) << boost::str (boost::format ("Keepalive req sent to %1%") % connection->socket->remote_endpoint ()); | ||
} | ||
connection->socket->async_write (bytes, [connection = connection](boost::system::error_code const & ec, size_t size_a) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connection = connection (?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connection is a member variable, so if you want to pass it in without passing this
this is the way to do it (and [&var = var] for reference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + test works locally
* Respond to keepalive messages within a TCP socket so we can determine version in both directions. * Fixing logging copy-pasta from frontier_req body. * Fixing double-counting incoming keepalives.
No description provided.