Skip to content

Send live network messages over TCP#1962

Merged
SergiySW merged 79 commits intonanocurrency:masterfrom
SergiySW:tcp/live_messages
May 22, 2019
Merged

Send live network messages over TCP#1962
SergiySW merged 79 commits intonanocurrency:masterfrom
SergiySW:tcp/live_messages

Conversation

@SergiySW
Copy link
Copy Markdown
Contributor

@SergiySW SergiySW commented May 7, 2019

@SergiySW SergiySW added enhancement incomplete This item is incomplete and should not be merged if it is a pull request rpc nonbreaking change networking labels May 7, 2019
@SergiySW SergiySW added this to the V19.0 milestone May 7, 2019
@SergiySW SergiySW self-assigned this May 7, 2019
@zhyatt zhyatt requested review from clemahieu and cryptocode May 7, 2019 13:29
return result;
}

nano::endpoint nano::transport::udp_channels::find_node_id (nano::account const & node_id_a)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should return the channel instead of the endpoint, the caller can always query for the endpoint if that's what they want.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

// clang-format on

// Close all TCP sockets
for (auto i (channels.begin ()), j (channels.end ()); i != j; ++i)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more tcp-induced cleanup complexity. This should be inside a tcp_channels class that's dedicated to managing tcp-related things.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

std::unordered_map<nano::endpoint, syn_cookie_info> syn_cookies;
std::unordered_map<boost::asio::ip::address, unsigned> syn_cookies_per_ip;
nano::node & node;
std::unordered_map<nano::tcp_endpoint, std::vector<nano::endpoint>> response_channels;
Copy link
Copy Markdown
Contributor

@clemahieu clemahieu May 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nano::network is responsible for managing response channels. Right now it's only udp_channels though we could create a new class tcp_channels which would also be inside nano::network and nano::network is responsible for live messages across all channel types.

nano::network should be able to handle the traffic in a transport-agnostic way.

- common tcp/udp channels functions moved to transport.hpp
- added last_packet_sent time_point
- RPC peers modified to return channel type with option "peer_details"
SergiySW added 3 commits May 10, 2019 01:10
- Sizes addes for each message types & subtypes
- New count field added to message header extensions (4 bit, max size 15) for confirm_req/confirm_ack by hash
- Node ID handshake header flags functions moved to nano::message_header instead from nano::node_id_handshake
- Tests expanded to check count extensions field
@SergiySW SergiySW force-pushed the tcp/live_messages branch from 0b5cfd2 to 4c2d80f Compare May 21, 2019 10:31
@SergiySW SergiySW force-pushed the tcp/live_messages branch from e6af6c8 to f0ddbcb Compare May 22, 2019 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants