From 17a3bb9337fd7e4a57354ed5359e449d5ab1388c Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 6 Sep 2023 18:36:44 +0200 Subject: deps: switch from non-boost to boost asio --- source/lib/control/src/connection.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'source/lib/control/src/connection.cpp') diff --git a/source/lib/control/src/connection.cpp b/source/lib/control/src/connection.cpp index 30fc8af..97f41dd 100644 --- a/source/lib/control/src/connection.cpp +++ b/source/lib/control/src/connection.cpp @@ -2,7 +2,11 @@ #include "wanda/proto/message.hpp" -#include +#include +#include +#include +#include +#include #include @@ -42,7 +46,7 @@ namespace wanda::control void connection::send(proto::message message) { m_output << message << '\n'; - asio::async_write(m_socket, m_out, asio::transfer_exactly(message.size() + 1), [that = shared_from_this(), this](auto const & error, auto const length) { + boost::asio::async_write(m_socket, m_out, boost::asio::transfer_exactly(message.size() + 1), [that = shared_from_this(), this](auto const & error, auto const length) { if (error) { // TODO: Handle error @@ -56,7 +60,9 @@ namespace wanda::control void connection::close() { - if (auto error = std::error_code{}; m_socket.cancel(error)) + auto error = boost::system::error_code{}; + + if (m_socket.cancel(error), error) { for (auto & listener : m_listeners) { @@ -64,7 +70,7 @@ namespace wanda::control } } - if (auto error = std::error_code{}; m_socket.close(error)) + if (m_socket.close(error), error) { for (auto & listener : m_listeners) { @@ -91,7 +97,7 @@ namespace wanda::control void connection::perform_read() { - asio::async_read_until(m_socket, m_in, '\n', [that = shared_from_this(), this](auto const & error, auto const length) { + boost::asio::async_read_until(m_socket, m_in, '\n', [that = shared_from_this(), this](auto const & error, auto const length) { if (error) { for (auto & listener : m_listeners) -- cgit v1.2.3