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

Move common UDP/TCP channels functions to transport #1971

Merged
merged 8 commits into from
May 14, 2019

Conversation

SergiySW
Copy link
Contributor

@SergiySW SergiySW commented May 9, 2019

  • 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"

- 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 SergiySW added this to the V19.0 milestone May 9, 2019
@SergiySW SergiySW requested review from clemahieu and cryptocode May 9, 2019 21:05
@SergiySW SergiySW self-assigned this May 9, 2019
@SergiySW
Copy link
Contributor Author

SergiySW commented May 9, 2019

Breaking up #1962

@SergiySW SergiySW changed the title Move common upd/tcp channels functions to transport Move common UDP/TCP channels functions to transport May 9, 2019
{
return nano::tcp_endpoint (endpoint_a.address (), endpoint_a.port ());
}

void nano::transport::channel::send_buffer (std::shared_ptr<std::vector<uint8_t>> buffer_a, nano::stat::detail detail_a, std::function<void(boost::system::error_code const &, size_t)> const & callback_a) const
{
send_buffer_raw (boost::asio::buffer (buffer_a->data (), buffer_a->size ()), callback (buffer_a, detail_a, callback_a));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here would be a good place to call set_last_packet_sent and then all then we don't need to do that at all the send_buffer call sites and we can't accidentally forget it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will remove const from send, send_buffer, send_buffer_raw
But make things easier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SergiySW SergiySW merged commit a691823 into nanocurrency:master May 14, 2019
SergiySW added a commit to SergiySW/raiblocks that referenced this pull request May 15, 2019
SergiySW added a commit that referenced this pull request May 15, 2019
@zhyatt zhyatt added rpc Changes related to Remote Procedure Calls and removed rpc nonbreaking change labels Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rpc Changes related to Remote Procedure Calls
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants