forked from eden-emu/eden
Fix windows boost compilation errors
This commit is contained in:
parent
2cdd8e07bd
commit
a351ea0212
2 changed files with 9 additions and 7 deletions
|
@ -26,8 +26,8 @@ public:
|
|||
using clock = std::chrono::system_clock;
|
||||
|
||||
explicit Socket(const std::string& host, u16 port, SocketCallback callback_)
|
||||
: callback(std::move(callback_)), timer(io_service),
|
||||
socket(io_service, udp::endpoint(udp::v4(), 0)), client_id(GenerateRandomClientId()) {
|
||||
: callback(std::move(callback_)), timer(io_context),
|
||||
socket(io_context, udp::endpoint(udp::v4(), 0)), client_id(GenerateRandomClientId()) {
|
||||
boost::system::error_code ec{};
|
||||
auto ipv4 = boost::asio::ip::make_address_v4(host, ec);
|
||||
if (ec.value() != boost::system::errc::success) {
|
||||
|
@ -39,11 +39,11 @@ public:
|
|||
}
|
||||
|
||||
void Stop() {
|
||||
io_service.stop();
|
||||
io_context.stop();
|
||||
}
|
||||
|
||||
void Loop() {
|
||||
io_service.run();
|
||||
io_context.run();
|
||||
}
|
||||
|
||||
void StartSend(const clock::time_point& from) {
|
||||
|
@ -113,10 +113,11 @@ private:
|
|||
}
|
||||
|
||||
SocketCallback callback;
|
||||
boost::asio::io_service io_service;
|
||||
boost::asio::io_context io_context;
|
||||
boost::asio::basic_waitable_timer<clock> timer;
|
||||
udp::socket socket;
|
||||
|
||||
|
||||
const u32 client_id;
|
||||
|
||||
static constexpr std::size_t PORT_INFO_SIZE = sizeof(Message<Request::PortInfo>);
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
#include "input_common/drivers/udp_client.h"
|
||||
#include "input_common/helpers/udp_protocol.h"
|
||||
|
||||
|
||||
class FakeCemuhookServer {
|
||||
public:
|
||||
FakeCemuhookServer()
|
||||
: socket(io_service, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 0)) {}
|
||||
: socket(io_context, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 0)) {}
|
||||
|
||||
~FakeCemuhookServer() {
|
||||
is_running = false;
|
||||
|
@ -82,7 +83,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
boost::asio::io_service io_service;
|
||||
boost::asio::io_context io_context;
|
||||
boost::asio::ip::udp::socket socket;
|
||||
std::array<u8, InputCommon::CemuhookUDP::MAX_PACKET_SIZE> send_buffer;
|
||||
std::array<u8, InputCommon::CemuhookUDP::MAX_PACKET_SIZE> receive_buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue