-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/Modernize-the-code #2
Conversation
Fix gcovr.cfg too
Correct error handling Update copyright notice
02e4fb2
to
ad0a22c
Compare
@@ -213,7 +215,7 @@ class client | |||
if (!error) | |||
{ | |||
// Extract the newline-delimited message from the buffer. | |||
std::string const line(input_buffer_.substr(0, n - 1)); | |||
std::string const line = input_buffer_.substr(0, n - 1); // NOTE: w/o '\n' |
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.
use initialiser list {}
async_tcp_client.cpp
Outdated
// XXX [this](const boost::system::error_code& /*e*/, PH1) { | ||
// handle_write(std::forward<decltype(PH1)>(PH1)); }); | ||
boost::asio::async_write(socket_, boost::asio::buffer(message), | ||
[this, self](const boost::system::error_code& error, std::size_t) { handle_write(error); }); |
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.
prevent use of this!
async_tcp_client.cpp
Outdated
// handle_read(std::forward<decltype(PH1)>(PH1), | ||
// std::forward<decltype(PH2)>(PH2)); }); | ||
boost::asio::async_read_until(socket_, boost::asio::dynamic_buffer(input_buffer_), '\n', | ||
[this, self](const boost::system::error_code& error, std::size_t n) { handle_read(error, n); }); |
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.
prevent use of this!
async_tcp_client.cpp
Outdated
// Put the actor back to sleep. | ||
// cpp11: deadline_.async_wait(std::bind(&client::check_deadline, this)); | ||
deadline_.async_wait([this](const boost::system::error_code& /*e*/) { check_deadline(); }); | ||
deadline_.async_wait([this, self](const boost::system::error_code& /*e*/) { check_deadline(); }); |
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.
prevent use of this!
async_tcp_client_v20.cpp
Outdated
|
||
// Start an asynchronous operation to send the message. | ||
boost::asio::async_write(socket_, boost::asio::buffer(message), | ||
[this, self](const boost::system::error_code& error, std::size_t) { handle_write(error); }); |
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.
prevent use of this!
@@ -137,18 +149,18 @@ class AsynchronousTCPClient : public std::enable_shared_from_this< AsynchronousT | |||
}); | |||
} | |||
|
|||
boost::asio::async_read_until(socket_, boost::asio::dynamic_buffer(data_), CR, | |||
boost::asio::async_read_until(socket_, boost::asio::dynamic_buffer(data_), STOP, | |||
[this, self](boost::system::error_code ec, std::size_t length) |
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.
prevent use of this!
async_tcp_client_v20.cpp
Outdated
auto self(shared_from_this()); | ||
|
||
// Put the actor back to sleep. | ||
deadline_.async_wait([this, self](const boost::system::error_code& /*e*/) { check_deadline(); }); |
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.
prevent use of this!
async_tcp_client_v20.cpp
Outdated
|
||
// Start an asynchronous operation to read a newline-delimited message. | ||
boost::asio::async_read_until(socket_, boost::asio::dynamic_buffer(input_buffer_), '\n', | ||
[this, self](const boost::system::error_code& error, std::size_t n) { handle_read(error, n); }); |
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.
prevent use of this!
async_tcp_client_v20.cpp
Outdated
|
||
// Start an asynchronous operation to send a heartbeat message. | ||
boost::asio::async_write(socket_, boost::asio::buffer(message), | ||
[this, self](const boost::system::error_code& error, std::size_t) { handle_write(error); }); |
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.
prevent use of this!
{ | ||
auto self(shared_from_this()); | ||
boost::asio::async_write(socket_, boost::asio::buffer(write_msgs_.front()), | ||
[this, self](boost::system::error_code ec, std::size_t /*length*/) |
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.
prevent use of this!
No description provided.