Skip to content
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

Merged
merged 3 commits into from Feb 18, 2019

Conversation

@clemahieu
Copy link
Collaborator

commented Feb 18, 2019

No description provided.

clemahieu added some commits Feb 18, 2019

@zhyatt zhyatt requested review from wezrule, cryptocode and SergiySW Feb 18, 2019

std::unique_ptr<nano::keepalive> request (new nano::keepalive (error, stream, header_a));
if (!error)
{
add_request (std::unique_ptr<nano::message> (request.release ()));

This comment has been minimized.

Copy link
@wezrule

wezrule Feb 18, 2019

Collaborator

can't this just be: add_request (std::move (request)); ?

This comment has been minimized.

Copy link
@clemahieu

clemahieu Feb 18, 2019

Author Collaborator

Yes, a lot of these need to be fixed to use c++13 semantics.

});

auto output (keepalive.to_bytes ());
bool done (false);

This comment has been minimized.

Copy link
@SergiySW

SergiySW Feb 18, 2019

Collaborator

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) {

This comment has been minimized.

Copy link
@SergiySW

SergiySW Feb 18, 2019

Collaborator

connection = connection (?)

This comment has been minimized.

Copy link
@wezrule

wezrule Feb 18, 2019

Collaborator

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)

@cryptocode
Copy link
Collaborator

left a comment

LGTM + test works locally

@SergiySW SergiySW added this to During RC in V18 Feb 18, 2019

@argakiig argakiig merged commit 685ffc9 into master Feb 18, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

argakiig added a commit that referenced this pull request Feb 18, 2019

Respond to keepalive messages within a TCP socket (#1742)
* 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.

@zhyatt zhyatt moved this from RC2 to RC3 in V18 Feb 18, 2019

@clemahieu clemahieu deleted the keepalive_tcp branch Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.