This commit is contained in:
2024-10-03 17:17:47 +03:00
parent 3d89dd3715
commit 22e20bb52f
2 changed files with 95 additions and 15 deletions

View File

@@ -303,24 +303,24 @@ public:
AdcNetServiceASIOBase& operator=(const AdcNetServiceASIOBase&) = delete;
AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other)
{
if (this != &other) {
close();
_streamBuffer.consume(_streamBuffer.size());
AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other) = delete;
// {
// if (this != &other) {
// close();
// _streamBuffer.consume(_streamBuffer.size());
auto bytes =
asio::buffer_copy(_streamBuffer.prepare(other._streamBuffer.size()), other._streamBuffer.data());
_streamBuffer.commit(bytes);
// auto bytes =
// asio::buffer_copy(_streamBuffer.prepare(other._streamBuffer.size()), other._streamBuffer.data());
// _streamBuffer.commit(bytes);
_ioContext = other._ioContext;
_receiveStrand = std::move(other._receiveStrand), _socket = std::move(other._socket);
// _ioContext = other._ioContext;
// _receiveStrand = std::move(other._receiveStrand), _socket = std::move(other._socket);
_receiveQueue = other._receiveQueue;
}
// _receiveQueue = other._receiveQueue;
// }
return *this;
}
// return *this;
// }
constexpr netservice_ident_t ident() const