Skip to content

Commit e18d6d3

Browse files
ReenigneArcherc2vi
authored andcommitted
build(deps): fix boost 1.87 compatibility (LizardByte#3457)
1 parent b5a92c5 commit e18d6d3

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/nvhttp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ namespace nvhttp {
4646

4747
class SunshineHTTPS: public SimpleWeb::HTTPS {
4848
public:
49-
SunshineHTTPS(boost::asio::io_service &io_service, boost::asio::ssl::context &ctx):
50-
SimpleWeb::HTTPS(io_service, ctx) {}
49+
SunshineHTTPS(boost::asio::io_context &io_context, boost::asio::ssl::context &ctx):
50+
SimpleWeb::HTTPS(io_context, ctx) {}
5151

5252
virtual ~SunshineHTTPS() {
5353
// Gracefully shutdown the TLS connection

src/rtsp.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ namespace rtsp_stream {
9292

9393
class socket_t: public std::enable_shared_from_this<socket_t> {
9494
public:
95-
socket_t(boost::asio::io_service &ios, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn):
96-
handle_data_fn { std::move(handle_data_fn) }, sock { ios } {}
95+
socket_t(boost::asio::io_context &io_context, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn):
96+
handle_data_fn { std::move(handle_data_fn) }, sock { io_context } {}
9797

9898
/**
9999
* @brief Queue an asynchronous read to begin the next message.
@@ -435,7 +435,7 @@ namespace rtsp_stream {
435435
return -1;
436436
}
437437

438-
next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
438+
next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
439439
handle_msg(sock, session, std::move(msg));
440440
});
441441

@@ -449,7 +449,7 @@ namespace rtsp_stream {
449449
template <class T, class X>
450450
void
451451
iterate(std::chrono::duration<T, X> timeout) {
452-
ios.run_one_for(timeout);
452+
io_context.run_one_for(timeout);
453453
}
454454

455455
void
@@ -494,7 +494,7 @@ namespace rtsp_stream {
494494
}
495495

496496
// Queue another asynchronous accept for the next incoming connection
497-
next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
497+
next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
498498
handle_msg(sock, session, std::move(msg));
499499
});
500500
acceptor.async_accept(next_socket->sock, [this](const auto &ec) {
@@ -618,8 +618,8 @@ namespace rtsp_stream {
618618

619619
std::chrono::steady_clock::time_point raised_timeout;
620620

621-
boost::asio::io_service ios;
622-
tcp::acceptor acceptor { ios };
621+
boost::asio::io_context io_context;
622+
tcp::acceptor acceptor { io_context };
623623

624624
std::shared_ptr<socket_t> next_socket;
625625
};

src/stream.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ namespace stream {
324324
std::thread audio_thread;
325325
std::thread control_thread;
326326

327-
asio::io_service io;
327+
asio::io_context io_context;
328328

329-
udp::socket video_sock { io };
330-
udp::socket audio_sock { io };
329+
udp::socket video_sock { io_context };
330+
udp::socket audio_sock { io_context };
331331

332332
control_server_t control_server;
333333
};
@@ -1183,7 +1183,7 @@ namespace stream {
11831183
auto &message_queue_queue = ctx.message_queue_queue;
11841184
auto broadcast_shutdown_event = mail::man->event<bool>(mail::broadcast_shutdown);
11851185

1186-
auto &io = ctx.io;
1186+
auto &io = ctx.io_context;
11871187

11881188
udp::endpoint peer;
11891189

@@ -1777,7 +1777,7 @@ namespace stream {
17771777
audio_packets->stop();
17781778

17791779
ctx.message_queue_queue->stop();
1780-
ctx.io.stop();
1780+
ctx.io_context.stop();
17811781

17821782
ctx.video_sock.close();
17831783
ctx.audio_sock.close();

0 commit comments

Comments
 (0)