Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
ReactorRunnable Class Reference
Collaboration diagram for ReactorRunnable:

Public Member Functions

int AddSocket (WorldSocket *sock)
long Connections ()
boost::asio::io_context & GetIoContext ()
 ReactorRunnable ()
void SocketClosed (WorldSocket *sock)
int Start ()
void Stop ()
void Wait ()
virtual ~ReactorRunnable ()

Private Types

typedef std::atomic< long > AtomicInt
typedef std::set< WorldSocket * > SocketSet

Private Attributes

AtomicInt m_Connections
SocketSet m_Sockets
std::mutex m_SocketsLock
std::atomic< bool > m_Stopped
Skyfire::Asio::IoContextThreadGroup m_ThreadGroup

Detailed Description

This is a helper class to WorldSocketMgr, that manages network threads, and assigning connections from acceptor thread to other network threads

Definition at line 34 of file WorldSocketMgr.cpp.

Member Typedef Documentation

◆ AtomicInt

typedef std::atomic<long> ReactorRunnable::AtomicInt
private

Definition at line 144 of file WorldSocketMgr.cpp.

◆ SocketSet

typedef std::set<WorldSocket*> ReactorRunnable::SocketSet
private

Definition at line 145 of file WorldSocketMgr.cpp.

Constructor & Destructor Documentation

◆ ReactorRunnable()

ReactorRunnable::ReactorRunnable ( )
inline

Definition at line 37 of file WorldSocketMgr.cpp.

References m_Connections, m_Stopped, and m_ThreadGroup.

◆ ~ReactorRunnable()

virtual ReactorRunnable::~ReactorRunnable ( )
inlinevirtual

Definition at line 44 of file WorldSocketMgr.cpp.

References Stop(), and Wait().

Member Function Documentation

◆ AddSocket()

◆ Connections()

long ReactorRunnable::Connections ( )
inline

Definition at line 86 of file WorldSocketMgr.cpp.

References m_Connections.

◆ GetIoContext()

boost::asio::io_context & ReactorRunnable::GetIoContext ( )
inline

Definition at line 91 of file WorldSocketMgr.cpp.

References m_ThreadGroup.

Referenced by WorldSocketMgr::GetNetworkIoContext().

◆ SocketClosed()

void ReactorRunnable::SocketClosed ( WorldSocket * sock)
inline

Definition at line 121 of file WorldSocketMgr.cpp.

References m_Connections, m_Sockets, m_SocketsLock, WorldSocket::RemoveReference(), and sScriptMgr.

Referenced by AddSocket().

◆ Start()

int ReactorRunnable::Start ( )
inline

Definition at line 68 of file WorldSocketMgr.cpp.

References m_ThreadGroup, and SF_LOG_DEBUG.

◆ Stop()

void ReactorRunnable::Stop ( )
inline

Definition at line 50 of file WorldSocketMgr.cpp.

References m_Sockets, m_SocketsLock, m_Stopped, and m_ThreadGroup.

Referenced by ~ReactorRunnable().

◆ Wait()

void ReactorRunnable::Wait ( )
inline

Definition at line 81 of file WorldSocketMgr.cpp.

References m_ThreadGroup.

Referenced by ~ReactorRunnable().

Member Data Documentation

◆ m_Connections

AtomicInt ReactorRunnable::m_Connections
private

Definition at line 148 of file WorldSocketMgr.cpp.

Referenced by AddSocket(), Connections(), ReactorRunnable(), and SocketClosed().

◆ m_Sockets

SocketSet ReactorRunnable::m_Sockets
private

Definition at line 151 of file WorldSocketMgr.cpp.

Referenced by AddSocket(), SocketClosed(), and Stop().

◆ m_SocketsLock

std::mutex ReactorRunnable::m_SocketsLock
private

Definition at line 152 of file WorldSocketMgr.cpp.

Referenced by AddSocket(), SocketClosed(), and Stop().

◆ m_Stopped

std::atomic<bool> ReactorRunnable::m_Stopped
private

Definition at line 149 of file WorldSocketMgr.cpp.

Referenced by AddSocket(), ReactorRunnable(), and Stop().

◆ m_ThreadGroup

Skyfire::Asio::IoContextThreadGroup ReactorRunnable::m_ThreadGroup
private

Definition at line 147 of file WorldSocketMgr.cpp.

Referenced by GetIoContext(), ReactorRunnable(), Start(), Stop(), and Wait().


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