-
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
Move common UDP/TCP channels functions to transport #1971
Move common UDP/TCP channels functions to transport #1971
Conversation
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"
Breaking up #1962 |
nano/node/transport/transport.cpp
Outdated
{ | ||
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)); |
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.
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.
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.
This will remove const from send, send_buffer, send_buffer_raw
But make things easier
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.
Error in PR nanocurrency#1971