This commit is contained in:
Timur A. Fatkhullin 2024-10-23 00:05:47 +03:00
parent addd13d826
commit a5c5e5057a

View File

@ -174,7 +174,6 @@ public:
} }
netservice_t srv{_ioContext}; netservice_t srv{_ioContext};
srv._socket = AdcNetServiceASIOBase::socket_t{_ioContext};
_socket = AdcNetServiceASIOBase::socket_t{_ioContext}; _socket = AdcNetServiceASIOBase::socket_t{_ioContext};
auto timer = getDeadlineTimer(_acceptor, timeout); auto timer = getDeadlineTimer(_acceptor, timeout);
@ -203,7 +202,7 @@ public:
case handshake_state: case handshake_state:
state = stop_state; state = stop_state;
handshake();
break; break;
case stop_state: case stop_state:
finalize(); finalize();
@ -272,7 +271,7 @@ public:
static constexpr std::chrono::duration DEFAULT_RECEIVE_TIMEOUT = std::chrono::seconds(5); static constexpr std::chrono::duration DEFAULT_RECEIVE_TIMEOUT = std::chrono::seconds(5);
AdcNetServiceASIOBase(asio::io_context& ctx) AdcNetServiceASIOBase(asio::io_context& ctx)
: SESSION_PROTOT(), _ioContext(ctx), _receiveStrand(_ioContext), _receiveQueue(), _socket(_ioContext) : SESSION_PROTOT(), _ioContext(ctx), _receiveStrand(_ioContext), _socket(_ioContext), _receiveQueue()
{ {
} }
@ -292,12 +291,11 @@ public:
AdcNetServiceASIOBase(AdcNetServiceASIOBase&& other) AdcNetServiceASIOBase(AdcNetServiceASIOBase&& other)
: _ioContext(other._ioContext), : _ioContext(other._ioContext),
_receiveStrand(std::move(other._receiveStrand)), _receiveStrand(std::move(other._receiveStrand)),
_receiveQueue(),
_socket(std::move(other._socket)), _socket(std::move(other._socket)),
_streamBuffer() _streamBuffer(),
_receiveQueue(std::move(other._receiveQueue))
{ {
_receiveQueue = std::move(_receiveQueue);
auto bytes = asio::buffer_copy(_streamBuffer.prepare(other._streamBuffer.size()), other._streamBuffer.data()); auto bytes = asio::buffer_copy(_streamBuffer.prepare(other._streamBuffer.size()), other._streamBuffer.data());
_streamBuffer.commit(bytes); _streamBuffer.commit(bytes);
} }
@ -317,7 +315,7 @@ public:
{ {
_ioContext = other._ioContext; _ioContext = other._ioContext;
_receiveStrand = std::move(other._receiveStrand); _receiveStrand = std::move(other._receiveStrand);
_receiveQueue = std::move(_receiveQueue); _receiveQueue = std::move(other._receiveQueue);
_socket = std::move(other._socket); _socket = std::move(other._socket);
_streamBuffer.consume(_streamBuffer.size()); _streamBuffer.consume(_streamBuffer.size());