This commit is contained in:
Timur A. Fatkhullin
2024-10-18 00:08:06 +03:00
parent 672788d59d
commit 60fa49bc29
2 changed files with 31 additions and 12 deletions

View File

@@ -266,7 +266,8 @@ public:
// NOTE: CANNOT MOVE asio::streambuf CORRECTLY?!!!
AdcNetServiceASIOBase(AdcNetServiceASIOBase&& other) = delete;
AdcNetServiceASIOBase(AdcNetServiceASIOBase&& other) = default;
// AdcNetServiceASIOBase(AdcNetServiceASIOBase&& other) = delete;
AdcNetServiceASIOBase(const AdcNetServiceASIOBase&) = delete; // no copy constructor!
virtual ~AdcNetServiceASIOBase() {}
@@ -274,7 +275,8 @@ public:
AdcNetServiceASIOBase& operator=(const AdcNetServiceASIOBase&) = delete;
AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other) = delete;
// AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other) = delete;
AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other) = default;
constexpr netservice_ident_t ident() const
@@ -362,6 +364,8 @@ public:
template <typename TokenT, traits::adc_time_duration_c TimeoutT = decltype(DEFAULT_RECEIVE_TIMEOUT)>
auto asyncReceive(TokenT&& token, const TimeoutT& timeout = DEFAULT_RECEIVE_TIMEOUT)
{
static asio::streambuf _streamBuffer;
// check completion token signature and deduce message type
// if constexpr (!adc_asio_special_comp_token_c<TokenT> && !is_async_ctx_t) {
if constexpr (!adc_asio_special_comp_token_c<TokenT>) {
@@ -562,7 +566,7 @@ protected:
socket_t _socket;
asio::streambuf _streamBuffer;
// asio::streambuf _streamBuffer;
std::queue<std::vector<char>> _receiveQueue;