1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Code cleanup

This commit is contained in:
Ivan Savenko
2024-01-20 00:26:25 +02:00
parent 93d78edfb9
commit baa73f5433
5 changed files with 18 additions and 18 deletions

View File

@ -26,7 +26,7 @@ void NetworkConnection::start()
boost::asio::async_read(*socket,
readBuffer,
boost::asio::transfer_exactly(messageHeaderSize),
std::bind(&NetworkConnection::onHeaderReceived,this, _1));
[this](const auto & ec, const auto & endpoint) { onHeaderReceived(ec); });
}
void NetworkConnection::onHeaderReceived(const boost::system::error_code & ec)
@ -42,7 +42,7 @@ void NetworkConnection::onHeaderReceived(const boost::system::error_code & ec)
boost::asio::async_read(*socket,
readBuffer,
boost::asio::transfer_exactly(messageSize),
std::bind(&NetworkConnection::onPacketReceived,this, _1, messageSize));
[this, messageSize](const auto & ec, const auto & endpoint) { onPacketReceived(ec, messageSize); });
}
uint32_t NetworkConnection::readPacketSize()