aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Networking
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-12-09 21:13:18 +0100
committerShauren <shauren.trinity@gmail.com>2024-12-09 21:13:18 +0100
commitc81183a6600722f3a9bb4996c0849b530fbdd1b0 (patch)
tree676a1c7ee6b6109ea70ddab9b5b11ab898757df5 /src/server/shared/Networking
parentbf0fe871948d196afcfe0c271c225fa3834e32fc (diff)
Dep: Replace basic_deadline_timer with std::chrono based basic_waitable_timer
Diffstat (limited to 'src/server/shared/Networking')
-rw-r--r--src/server/shared/Networking/Http/HttpService.cpp4
-rw-r--r--src/server/shared/Networking/NetworkThread.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/shared/Networking/Http/HttpService.cpp b/src/server/shared/Networking/Http/HttpService.cpp
index 8bb533d73c0..b01e27e296a 100644
--- a/src/server/shared/Networking/Http/HttpService.cpp
+++ b/src/server/shared/Networking/Http/HttpService.cpp
@@ -142,7 +142,7 @@ void SessionService::InitAndStoreSessionState(std::shared_ptr<SessionState> stat
void SessionService::Start(Asio::IoContext& ioContext)
{
_inactiveSessionsKillTimer = std::make_unique<Asio::DeadlineTimer>(ioContext);
- _inactiveSessionsKillTimer->expires_from_now(boost::posix_time::minutes(1));
+ _inactiveSessionsKillTimer->expires_after(1min);
_inactiveSessionsKillTimer->async_wait([this](boost::system::error_code const& err)
{
if (err)
@@ -255,7 +255,7 @@ void SessionService::KillInactiveSessions()
}
}
- _inactiveSessionsKillTimer->expires_from_now(boost::posix_time::minutes(1));
+ _inactiveSessionsKillTimer->expires_after(1min);
_inactiveSessionsKillTimer->async_wait([this](boost::system::error_code const& err)
{
if (err)
diff --git a/src/server/shared/Networking/NetworkThread.h b/src/server/shared/Networking/NetworkThread.h
index 0195c48b9fc..fc7d9647fc1 100644
--- a/src/server/shared/Networking/NetworkThread.h
+++ b/src/server/shared/Networking/NetworkThread.h
@@ -117,7 +117,7 @@ protected:
{
TC_LOG_DEBUG("misc", "Network Thread Starting");
- _updateTimer.expires_from_now(boost::posix_time::milliseconds(1));
+ _updateTimer.expires_after(1ms);
_updateTimer.async_wait([this](boost::system::error_code const&) { Update(); });
_ioContext.run();
@@ -131,7 +131,7 @@ protected:
if (_stopped)
return;
- _updateTimer.expires_from_now(boost::posix_time::milliseconds(1));
+ _updateTimer.expires_after(1ms);
_updateTimer.async_wait([this](boost::system::error_code const&) { Update(); });
AddNewSockets();