TrinityCore
SocketMgr< SocketType > Class Template Referenceabstract

#include <SocketMgr.h>

Public Member Functions

virtual ~SocketMgr ()
 
virtual bool StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount)
 
virtual void StopNetwork ()
 
void Wait ()
 
virtual void OnSocketOpen (boost::asio::ip::tcp::socket &&sock, uint32 threadIndex)
 
int32 GetNetworkThreadCount () const
 
uint32 SelectThreadWithMinConnections () const
 
std::pair< boost::asio::ip::tcp::socket *, uint32GetSocketForAccept ()
 

Protected Member Functions

 SocketMgr ()
 
virtual NetworkThread< SocketType > * CreateThreads () const =0
 

Protected Attributes

AsyncAcceptor_acceptor
 
NetworkThread< SocketType > * _threads
 
int32 _threadCount
 

Detailed Description

template<class SocketType>
class SocketMgr< SocketType >

Definition at line 28 of file SocketMgr.h.

Constructor & Destructor Documentation

◆ ~SocketMgr()

template<class SocketType >
virtual SocketMgr< SocketType >::~SocketMgr ( )
inlinevirtual

Definition at line 31 of file SocketMgr.h.

◆ SocketMgr()

template<class SocketType >
SocketMgr< SocketType >::SocketMgr ( )
inlineprotected

Definition at line 131 of file SocketMgr.h.

Member Function Documentation

◆ CreateThreads()

template<class SocketType >
virtual NetworkThread< SocketType > * SocketMgr< SocketType >::CreateThreads ( ) const
protectedpure virtual

Implemented in Battlenet::SessionManager, WorldSocketMgr, Trinity::Net::Http::HttpService< SessionImpl >, and Trinity::Net::Http::HttpService< LoginHttpSession >.

+ Here is the caller graph for this function:

◆ GetNetworkThreadCount()

template<class SocketType >
int32 SocketMgr< SocketType >::GetNetworkThreadCount ( ) const
inline

Definition at line 111 of file SocketMgr.h.

◆ GetSocketForAccept()

template<class SocketType >
std::pair< boost::asio::ip::tcp::socket *, uint32 > SocketMgr< SocketType >::GetSocketForAccept ( )
inline

Definition at line 124 of file SocketMgr.h.

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

◆ OnSocketOpen()

template<class SocketType >
virtual void SocketMgr< SocketType >::OnSocketOpen ( boost::asio::ip::tcp::socket &&  sock,
uint32  threadIndex 
)
inlinevirtual

Reimplemented in WorldSocketMgr.

Definition at line 96 of file SocketMgr.h.

◆ SelectThreadWithMinConnections()

template<class SocketType >
uint32 SocketMgr< SocketType >::SelectThreadWithMinConnections ( ) const
inline

Definition at line 113 of file SocketMgr.h.

+ Here is the caller graph for this function:

◆ StartNetwork()

template<class SocketType >
virtual bool SocketMgr< SocketType >::StartNetwork ( Trinity::Asio::IoContext ioContext,
std::string const &  bindIp,
uint16  port,
int  threadCount 
)
inlinevirtual

Reimplemented in WorldSocketMgr, and Battlenet::SessionManager.

Definition at line 36 of file SocketMgr.h.

+ Here is the call graph for this function:

◆ StopNetwork()

template<class SocketType >
virtual void SocketMgr< SocketType >::StopNetwork ( )
inlinevirtual

Reimplemented in WorldSocketMgr, Trinity::Net::Http::HttpService< SessionImpl >, and Trinity::Net::Http::HttpService< LoginHttpSession >.

Definition at line 72 of file SocketMgr.h.

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

◆ Wait()

template<class SocketType >
void SocketMgr< SocketType >::Wait ( )
inline

Definition at line 89 of file SocketMgr.h.

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

Member Data Documentation

◆ _acceptor

template<class SocketType >
AsyncAcceptor* SocketMgr< SocketType >::_acceptor
protected

Definition at line 137 of file SocketMgr.h.

◆ _threadCount

template<class SocketType >
int32 SocketMgr< SocketType >::_threadCount
protected

Definition at line 139 of file SocketMgr.h.

◆ _threads

template<class SocketType >
NetworkThread<SocketType>* SocketMgr< SocketType >::_threads
protected

Definition at line 138 of file SocketMgr.h.


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