@@ -92,8 +92,8 @@ namespace rtsp_stream {
92
92
93
93
class socket_t : public std ::enable_shared_from_this<socket_t > {
94
94
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 } {}
97
97
98
98
/* *
99
99
* @brief Queue an asynchronous read to begin the next message.
@@ -435,7 +435,7 @@ namespace rtsp_stream {
435
435
return -1 ;
436
436
}
437
437
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) {
439
439
handle_msg (sock, session, std::move (msg));
440
440
});
441
441
@@ -449,7 +449,7 @@ namespace rtsp_stream {
449
449
template <class T , class X >
450
450
void
451
451
iterate (std::chrono::duration<T, X> timeout) {
452
- ios .run_one_for (timeout);
452
+ io_context .run_one_for (timeout);
453
453
}
454
454
455
455
void
@@ -494,7 +494,7 @@ namespace rtsp_stream {
494
494
}
495
495
496
496
// 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) {
498
498
handle_msg (sock, session, std::move (msg));
499
499
});
500
500
acceptor.async_accept (next_socket->sock , [this ](const auto &ec) {
@@ -618,8 +618,8 @@ namespace rtsp_stream {
618
618
619
619
std::chrono::steady_clock::time_point raised_timeout;
620
620
621
- boost::asio::io_service ios ;
622
- tcp::acceptor acceptor { ios };
621
+ boost::asio::io_context io_context ;
622
+ tcp::acceptor acceptor { io_context };
623
623
624
624
std::shared_ptr<socket_t > next_socket;
625
625
};
0 commit comments