1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Cleanup, remove unnecessary changes

This commit is contained in:
Ivan Savenko
2025-06-29 16:26:23 +03:00
parent 52da332640
commit 3ea2c8bff0
11 changed files with 30 additions and 41 deletions

View File

@@ -208,15 +208,15 @@ void NetworkConnection::close()
//NOTE: ignoring error code, intended
}
InternalConnection::InternalConnection(INetworkConnectionListener & listener, NetworkStrand & strand)
: strand(strand)
InternalConnection::InternalConnection(INetworkConnectionListener & listener, NetworkContext & context)
: context(context)
, listener(listener)
{
}
void InternalConnection::receivePacket(const std::vector<std::byte> & message)
{
strand.post([self = std::static_pointer_cast<InternalConnection>(shared_from_this()), message](){
boost::asio::post(context, [self = std::static_pointer_cast<InternalConnection>(shared_from_this()), message](){
if (self->connectionActive)
self->listener.onPacketReceived(self, message);
});
@@ -224,7 +224,7 @@ void InternalConnection::receivePacket(const std::vector<std::byte> & message)
void InternalConnection::disconnect()
{
strand.post([self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){
boost::asio::post(context, [self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){
self->listener.onDisconnected(self, "Internal connection has been terminated");
self->otherSideWeak.reset();
self->connectionActive = false;