From 4f783a41d9927c2aad8b688e30d3a7a8aa81ba4f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 12 Mar 2026 15:23:44 +0100 Subject: Replace deprecated boost::asio::deadline_timer with boost::asio::system_timer. --- src/lib/dcpomatic_socket.cc | 8 ++++---- src/lib/dcpomatic_socket.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/dcpomatic_socket.cc b/src/lib/dcpomatic_socket.cc index 497699c79..271de3cc2 100644 --- a/src/lib/dcpomatic_socket.cc +++ b/src/lib/dcpomatic_socket.cc @@ -43,16 +43,16 @@ Socket::Socket(int timeout) , _socket(_io_context) , _timeout(timeout) { - _deadline.expires_at(boost::posix_time::pos_infin); + _deadline.expires_at(std::chrono::time_point::max()); check(); } void Socket::check() { - if (_deadline.expires_at() <= boost::asio::deadline_timer::traits_type::now()) { + if (_deadline.expires_at() <= std::chrono::system_clock::now()) { _socket.close(); - _deadline.expires_at(boost::posix_time::pos_infin); + _deadline.expires_at(std::chrono::time_point::max()); } _deadline.async_wait(boost::bind(&Socket::check, this)); @@ -321,7 +321,7 @@ Socket::set_send_buffer_size (int size) void Socket::set_deadline_from_now(int seconds) { - _deadline.expires_from_now(boost::posix_time::seconds(seconds)); + _deadline.expires_from_now(std::chrono::seconds(seconds)); } void diff --git a/src/lib/dcpomatic_socket.h b/src/lib/dcpomatic_socket.h index 4badfd14b..27e9ed318 100644 --- a/src/lib/dcpomatic_socket.h +++ b/src/lib/dcpomatic_socket.h @@ -22,7 +22,7 @@ #include "digester.h" #include "io_context.h" #include -#include +#include #include @@ -102,7 +102,7 @@ private: #endif dcpomatic::io_context _io_context; - boost::asio::deadline_timer _deadline; + boost::asio::system_timer _deadline; boost::asio::ip::tcp::socket _socket; int _timeout; boost::scoped_ptr _read_digester; -- cgit v1.2.3