mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Use boost::asio::post instead of deprecated io_service::post
This commit is contained in:
		| @@ -216,7 +216,7 @@ InternalConnection::InternalConnection(INetworkConnectionListener & listener, co | ||||
|  | ||||
| void InternalConnection::receivePacket(const std::vector<std::byte> & message) | ||||
| { | ||||
| 	io->post([self = std::static_pointer_cast<InternalConnection>(shared_from_this()), message](){ | ||||
| 	boost::asio::post(*io, [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() | ||||
| { | ||||
| 	io->post([self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){ | ||||
| 	boost::asio::post(*io, [self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){ | ||||
| 		self->listener.onDisconnected(self, "Internal connection has been terminated"); | ||||
| 		self->otherSideWeak.reset(); | ||||
| 		self->connectionActive = false; | ||||
|   | ||||
| @@ -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); | ||||
| 	}); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user