...
This commit is contained in:
@@ -219,6 +219,9 @@ public:
|
||||
_socket(std::move(other._socket)),
|
||||
_streamBuffer()
|
||||
{
|
||||
if (*this == other)
|
||||
return;
|
||||
|
||||
auto bytes = asio::buffer_copy(_streamBuffer.prepare(other._streamBuffer.size()), other._streamBuffer.data());
|
||||
_streamBuffer.commit(bytes);
|
||||
};
|
||||
@@ -228,6 +231,29 @@ public:
|
||||
virtual ~AdcNetServiceASIOBase() {}
|
||||
|
||||
|
||||
AdcNetServiceASIOBase& operator=(const AdcNetServiceASIOBase&) = delete;
|
||||
|
||||
AdcNetServiceASIOBase& operator=(AdcNetServiceASIOBase&& other)
|
||||
{
|
||||
if (*this != other) {
|
||||
close();
|
||||
_streamBuffer.consume(_streamBuffer.size());
|
||||
|
||||
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);
|
||||
_acceptor = std::move(other._acceptor);
|
||||
|
||||
_receiveQueue = other._receiveQueue;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
constexpr netservice_ident_t ident() const
|
||||
{
|
||||
return _ident;
|
||||
|
||||
Reference in New Issue
Block a user