1515
1616#define BOOST_ASIO_NO_DEPRECATED
1717#include " cancellation.h"
18- #include < boost/ asio/basic_stream_socket.hpp>
19- #include < boost/ asio/io_context.hpp>
20- #include < boost/ asio/ip/tcp.hpp>
18+ #include < asio/basic_stream_socket.hpp>
19+ #include < asio/io_context.hpp>
20+ #include < asio/ip/tcp.hpp>
2121#include < exception>
2222#include < streambuf>
2323
24- namespace asio = lslboost::asio;
25- using lslboost::system::error_code;
2624using asio::io_context;
2725
2826namespace lsl {
@@ -73,7 +71,8 @@ class cancellable_streambuf : public std::streambuf,
7371
7472 init_buffers ();
7573 socket ().close (ec_);
76- socket ().async_connect (endpoint, [this ](const error_code &ec) { this ->ec_ = ec; });
74+ socket ().async_connect (
75+ endpoint, [this ](const asio::error_code &ec) { this ->ec_ = ec; });
7776 this ->as_context ().restart ();
7877 }
7978 ec_ = asio::error::would_block;
@@ -98,7 +97,7 @@ class cancellable_streambuf : public std::streambuf,
9897 * @return An \c error_code corresponding to the last error from the stream
9998 * buffer.
10099 */
101- const error_code &error () const { return ec_; }
100+ const asio:: error_code &error () const { return ec_; }
102101
103102protected:
104103 // / Close the socket if it's open.
@@ -131,7 +130,7 @@ class cancellable_streambuf : public std::streambuf,
131130 std::size_t bytes_transferred_;
132131 socket ().async_receive (asio::buffer (asio::buffer (get_buffer_) + putback_max),
133132 [this , &bytes_transferred_](
134- const error_code &ec, std::size_t bytes_transferred = 0 ) {
133+ const asio:: error_code &ec, std::size_t bytes_transferred = 0 ) {
135134 this ->ec_ = ec;
136135 bytes_transferred_ = bytes_transferred;
137136 });
@@ -154,8 +153,9 @@ class cancellable_streambuf : public std::streambuf,
154153 asio::const_buffer buffer = asio::buffer (pbase (), pptr () - pbase ());
155154 while (asio::buffer_size (buffer) > 0 ) {
156155 std::size_t bytes_transferred_;
157- socket ().async_send (asio::buffer (buffer),
158- [this , &bytes_transferred_](const error_code &ec, std::size_t bytes_transferred) {
156+ socket ().async_send (
157+ asio::buffer (buffer), [this , &bytes_transferred_](const asio::error_code &ec,
158+ std::size_t bytes_transferred) {
159159 this ->ec_ = ec;
160160 bytes_transferred_ = bytes_transferred;
161161 });
@@ -192,7 +192,7 @@ class cancellable_streambuf : public std::streambuf,
192192 enum { putback_max = 8 };
193193 enum { buffer_size = 512 };
194194 char get_buffer_[buffer_size], put_buffer_[buffer_size];
195- error_code ec_;
195+ asio:: error_code ec_;
196196 std::atomic<bool > cancel_issued_{false };
197197 bool cancel_started_{false };
198198 std::recursive_mutex cancel_mut_;
0 commit comments