Replace deprecated and removed in boost 1.88 io_service to io_context (#1126)

* Replace deprecated and removed in boost 1.88 io_service for io_context

* More thoroughly replaced references to io_service with io_context

* Updated license header

---------

Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
This commit is contained in:
qr243vbi 2025-06-17 21:41:22 +03:00 committed by GitHub
parent 3c3dd2bd86
commit ce8798fffe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
// Copyright 2018 Citra Emulator Project // Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
@ -29,8 +29,8 @@ public:
explicit Socket(const std::string& host, u16 port, u8 pad_index, u32 client_id, explicit Socket(const std::string& host, u16 port, u8 pad_index, u32 client_id,
SocketCallback callback) SocketCallback callback)
: callback(std::move(callback)), timer(io_service), : callback(std::move(callback)), timer(io_context),
socket(io_service, udp::endpoint(udp::v4(), 0)), client_id(client_id), socket(io_context, udp::endpoint(udp::v4(), 0)), client_id(client_id),
pad_index(pad_index) { pad_index(pad_index) {
boost::system::error_code ec{}; boost::system::error_code ec{};
auto ipv4 = boost::asio::ip::make_address_v4(host, ec); auto ipv4 = boost::asio::ip::make_address_v4(host, ec);
@ -43,11 +43,11 @@ public:
} }
void Stop() { void Stop() {
io_service.stop(); io_context.stop();
} }
void Loop() { void Loop() {
io_service.run(); io_context.run();
} }
void StartSend(const clock::time_point& from) { void StartSend(const clock::time_point& from) {
@ -108,7 +108,7 @@ private:
} }
SocketCallback callback; SocketCallback callback;
boost::asio::io_service io_service; boost::asio::io_context io_context;
boost::asio::basic_waitable_timer<clock> timer; boost::asio::basic_waitable_timer<clock> timer;
udp::socket socket; udp::socket socket;