From b1ae36bdff8b718fc8ae479772076a439be33aab Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 13 Feb 2025 21:36:24 +0000 Subject: [PATCH] Use boost::asio::post instead of deprecated io_service::post --- lib/network/NetworkConnection.cpp | 4 ++-- lib/network/NetworkHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/network/NetworkConnection.cpp b/lib/network/NetworkConnection.cpp index 3c8d7934e..f1114821c 100644 --- a/lib/network/NetworkConnection.cpp +++ b/lib/network/NetworkConnection.cpp @@ -216,7 +216,7 @@ InternalConnection::InternalConnection(INetworkConnectionListener & listener, co void InternalConnection::receivePacket(const std::vector & message) { - io->post([self = std::static_pointer_cast(shared_from_this()), message](){ + boost::asio::post(*io, [self = std::static_pointer_cast(shared_from_this()), message](){ if (self->connectionActive) self->listener.onPacketReceived(self, message); }); @@ -224,7 +224,7 @@ void InternalConnection::receivePacket(const std::vector & message) void InternalConnection::disconnect() { - io->post([self = std::static_pointer_cast(shared_from_this())](){ + boost::asio::post(*io, [self = std::static_pointer_cast(shared_from_this())](){ self->listener.onDisconnected(self, "Internal connection has been terminated"); self->otherSideWeak.reset(); self->connectionActive = false; diff --git a/lib/network/NetworkHandler.cpp b/lib/network/NetworkHandler.cpp index add791490..4634db414 100644 --- a/lib/network/NetworkHandler.cpp +++ b/lib/network/NetworkHandler.cpp @@ -79,7 +79,7 @@ void NetworkHandler::createInternalConnection(INetworkClientListener & listener, server.receiveInternalConnection(localConnection); - io->post([&listener, localConnection](){ + boost::asio::post(*io, [&listener, localConnection](){ listener.onConnectionEstablished(localConnection); }); }