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
Fix deprecated API in Boost.asio #451
Conversation
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.
get_executor() was introduced in Boost 1.66, released in December 2017.
It will break on Debian 9 stretch and Ubuntu 18.04 LTS as they have older versions of libboost-dev (1.62 and 1.65).
examples/ace/ttcp/ttcp_asio_async.cc
Outdated
@@ -21,8 +21,8 @@ class TtcpServerConnection : public std::enable_shared_from_this<TtcpServerConne | |||
muduo::noncopyable | |||
{ | |||
public: | |||
TtcpServerConnection(boost::asio::io_service& io_service) | |||
: socket_(io_service), count_(0), payload_(NULL), ack_(0) | |||
TtcpServerConnection(boost::asio::executor executor) |
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.
Why pass by value not by const-reference?
The future readers and maintainers will have the same question here.
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.
Thanks for your reply. I've pushed a new commit to fix this. Apparently, const-reference is a better choice here.
I fully understand that the PR will make the older version fail to build. So, whether a PR (with the latest commit) is merged depends on you. If not, maybe I should close the PR and leave it to the issue #429 to help others who want to use new version Boost.asio.
Can you make it work for both old and new Boost versions by checking the BOOST_VERSION macro? |
OK. A new commit is pushed in my repo. Don't know whether |
* Fix deprecated API in Boost.Asio * Use BOOST_VERSION macro to make it work for both old and new Boost versions Cherry-pick: 52840b8
get_io_service
is marked as deprecated for a long time. Since Boost 1.70, it is removed. So with the latest version Boost, it will cause build fail.According to the release notes, fix the deprecated API, and confirmed with Boost 1.72.