Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
WorldSocketMgr Class Reference

Manages all sockets connected to peers and network threads. More...

#include <WorldSocketMgr.h>

Collaboration diagram for WorldSocketMgr:

Public Member Functions

int StartNetwork (uint16 port, const char *address)
 Start network, listen at address:port .
void StopNetwork ()
 Stops all network threads, It will wait for all running threads .
void Wait ()
 Wait untill all network threads have "joined" .

Private Member Functions

boost::asio::io_context & GetNetworkIoContext (ReactorRunnable *reactor)
int OnSocketOpen (WorldSocket *sock, ReactorRunnable *reactor)
ReactorRunnableSelectNetworkThread ()
int StartReactiveIO (uint16 port, const char *address)
 WorldSocketMgr ()
virtual ~WorldSocketMgr ()

Private Attributes

class WorldSocketAcceptorm_Acceptor
ReactorRunnablem_NetThreads
size_t m_NetThreadsCount
int m_SockOutKBuff
int m_SockOutUBuff
bool m_UseNoDelay

Friends

class Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >
class WorldSocket
class WorldSocketAcceptor

Detailed Description

Manages all sockets connected to peers and network threads.

Definition at line 23 of file WorldSocketMgr.h.

Constructor & Destructor Documentation

◆ WorldSocketMgr()

WorldSocketMgr::WorldSocketMgr ( )
private

Member Function Documentation

◆ GetNetworkIoContext()

boost::asio::io_context & WorldSocketMgr::GetNetworkIoContext ( ReactorRunnable * reactor)
private

◆ OnSocketOpen()

◆ SelectNetworkThread()

ReactorRunnable * WorldSocketMgr::SelectNetworkThread ( )
private

◆ StartNetwork()

int WorldSocketMgr::StartNetwork ( uint16 port,
const char * address )

Start network, listen at address:port .

Definition at line 232 of file WorldSocketMgr.cpp.

References sScriptMgr, and StartReactiveIO().

Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.

◆ StartReactiveIO()

int WorldSocketMgr::StartReactiveIO ( uint16 port,
const char * address )
private

◆ StopNetwork()

void WorldSocketMgr::StopNetwork ( )

Stops all network threads, It will wait for all running threads .

Definition at line 243 of file WorldSocketMgr.cpp.

References m_Acceptor, m_NetThreads, m_NetThreadsCount, sScriptMgr, and Wait().

Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.

◆ Wait()

void WorldSocketMgr::Wait ( )

Wait untill all network threads have "joined" .

Definition at line 262 of file WorldSocketMgr.cpp.

References m_NetThreads, m_NetThreadsCount, and Wait().

Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >, StartReactiveIO(), StopNetwork(), and Wait().

◆ ~WorldSocketMgr()

WorldSocketMgr::~WorldSocketMgr ( )
privatevirtual

Definition at line 163 of file WorldSocketMgr.cpp.

References m_Acceptor, and m_NetThreads.

◆ Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >

◆ WorldSocket

friend class WorldSocket
friend

Definition at line 26 of file WorldSocketMgr.h.

References WorldSocket.

Referenced by OnSocketOpen(), and WorldSocket.

◆ WorldSocketAcceptor

friend class WorldSocketAcceptor
friend

Member Data Documentation

◆ m_Acceptor

class WorldSocketAcceptor* WorldSocketMgr::m_Acceptor
private

Definition at line 57 of file WorldSocketMgr.h.

Referenced by StartReactiveIO(), StopNetwork(), WorldSocketMgr(), and ~WorldSocketMgr().

◆ m_NetThreads

ReactorRunnable* WorldSocketMgr::m_NetThreads
private

◆ m_NetThreadsCount

size_t WorldSocketMgr::m_NetThreadsCount
private

◆ m_SockOutKBuff

int WorldSocketMgr::m_SockOutKBuff
private

Definition at line 53 of file WorldSocketMgr.h.

Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().

◆ m_SockOutUBuff

int WorldSocketMgr::m_SockOutUBuff
private

Definition at line 54 of file WorldSocketMgr.h.

Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().

◆ m_UseNoDelay

bool WorldSocketMgr::m_UseNoDelay
private

Definition at line 55 of file WorldSocketMgr.h.

Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().


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