net: replace deprecated boost::asio::strand::wrap with bind_executor

This commit is contained in:
ryurt46
2026-05-04 19:01:04 +02:00
parent dace76882d
commit a5ab8e5709
2 changed files with 5 additions and 5 deletions
+2 -1
View File
@@ -37,6 +37,7 @@
#include <boost/asio/strand.hpp> #include <boost/asio/strand.hpp>
#include <condition_variable> #include <condition_variable>
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <boost/asio/bind_executor.hpp>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include "misc_log_ex.h" #include "misc_log_ex.h"
@@ -615,7 +616,7 @@ bool ssl_options_t::handshake(
socket.async_handshake( socket.async_handshake(
type, type,
boost::asio::buffer(buffer), boost::asio::buffer(buffer),
strand.wrap(on_handshake) boost::asio::bind_executor(strand, on_handshake)
); );
} }
); );
+3 -4
View File
@@ -33,6 +33,7 @@
#include <boost/asio/steady_timer.hpp> #include <boost/asio/steady_timer.hpp>
#include <boost/system/system_error.hpp> #include <boost/system/system_error.hpp>
#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_io.hpp>
#include <boost/asio/bind_executor.hpp>
#include <chrono> #include <chrono>
#include <deque> #include <deque>
#include <stdexcept> #include <stdexcept>
@@ -354,7 +355,7 @@ namespace levin
detail::zone& this_zone = *zone; detail::zone& this_zone = *zone;
++this_zone.flush_callbacks; ++this_zone.flush_callbacks;
this_zone.flush_txs.expires_at(flush_time); this_zone.flush_txs.expires_at(flush_time);
this_zone.flush_txs.async_wait(this_zone.strand.wrap(fluff_flush{std::move(zone)})); this_zone.flush_txs.async_wait(boost::asio::bind_executor(this_zone.strand, fluff_flush{std::move(zone)}));
} }
void operator()(const boost::system::error_code error) void operator()(const boost::system::error_code error)
@@ -628,9 +629,7 @@ namespace levin
noise_channel& channel = zone->channels.at(index); noise_channel& channel = zone->channels.at(index);
channel.next_noise.expires_at(start + noise_min_delay + random_duration(noise_delay_range)); channel.next_noise.expires_at(start + noise_min_delay + random_duration(noise_delay_range));
channel.next_noise.async_wait( channel.next_noise.async_wait(boost::asio::bind_executor(channel.strand, send_noise{std::move(zone), index, core}));
channel.strand.wrap(send_noise{std::move(zone), index, core})
);
} }
//! \pre Called within `zone_->channels[channel_].strand`. //! \pre Called within `zone_->channels[channel_].strand`.