TrinityCore
Trinity::Net::Http::SessionService Class Reference

#include <HttpService.h>

+ Inheritance diagram for Trinity::Net::Http::SessionService:

Public Member Functions

 SessionService (std::string_view loggerSuffix)
 
void Start (Asio::IoContext &ioContext)
 
void Stop ()
 
std::shared_ptr< SessionStateFindAndRefreshSessionState (std::string_view id, boost::asio::ip::address const &address)
 
void MarkSessionInactive (boost::uuids::uuid const &id)
 

Protected Member Functions

void InitAndStoreSessionState (std::shared_ptr< SessionState > state, boost::asio::ip::address const &address)
 
void KillInactiveSessions ()
 

Private Attributes

std::shared_mutex _sessionsMutex
 
std::map< boost::uuids::uuid, std::shared_ptr< SessionState > > _sessions
 
std::mutex _inactiveSessionsMutex
 
std::set< boost::uuids::uuid > _inactiveSessions
 
std::unique_ptr< Asio::DeadlineTimer_inactiveSessionsKillTimer
 
std::string _logger
 

Detailed Description

Definition at line 82 of file HttpService.h.

Constructor & Destructor Documentation

◆ SessionService()

Trinity::Net::Http::SessionService::SessionService ( std::string_view  loggerSuffix)
inlineexplicit

Definition at line 85 of file HttpService.h.

Member Function Documentation

◆ FindAndRefreshSessionState()

std::shared_ptr< SessionState > Trinity::Net::Http::SessionService::FindAndRefreshSessionState ( std::string_view  id,
boost::asio::ip::address const &  address 
)

Definition at line 168 of file HttpService.cpp.

◆ InitAndStoreSessionState()

void Trinity::Net::Http::SessionService::InitAndStoreSessionState ( std::shared_ptr< SessionState state,
boost::asio::ip::address const &  address 
)
protected

Definition at line 126 of file HttpService.cpp.

+ Here is the caller graph for this function:

◆ KillInactiveSessions()

void Trinity::Net::Http::SessionService::KillInactiveSessions ( )
protected

Definition at line 219 of file HttpService.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MarkSessionInactive()

void Trinity::Net::Http::SessionService::MarkSessionInactive ( boost::uuids::uuid const &  id)

Definition at line 199 of file HttpService.cpp.

+ Here is the caller graph for this function:

◆ Start()

void Trinity::Net::Http::SessionService::Start ( Asio::IoContext ioContext)

Definition at line 142 of file HttpService.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stop()

void Trinity::Net::Http::SessionService::Stop ( )

Definition at line 155 of file HttpService.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _inactiveSessions

std::set<boost::uuids::uuid> Trinity::Net::Http::SessionService::_inactiveSessions
private

Definition at line 106 of file HttpService.h.

◆ _inactiveSessionsKillTimer

std::unique_ptr<Asio::DeadlineTimer> Trinity::Net::Http::SessionService::_inactiveSessionsKillTimer
private

Definition at line 107 of file HttpService.h.

◆ _inactiveSessionsMutex

std::mutex Trinity::Net::Http::SessionService::_inactiveSessionsMutex
private

Definition at line 105 of file HttpService.h.

◆ _logger

std::string Trinity::Net::Http::SessionService::_logger
private

Definition at line 109 of file HttpService.h.

◆ _sessions

std::map<boost::uuids::uuid, std::shared_ptr<SessionState> > Trinity::Net::Http::SessionService::_sessions
private

Definition at line 103 of file HttpService.h.

◆ _sessionsMutex

std::shared_mutex Trinity::Net::Http::SessionService::_sessionsMutex
private

Definition at line 102 of file HttpService.h.


The documentation for this class was generated from the following files: