TrinityCore
Loading...
Searching...
No Matches
Trinity::Net::SocketMgr< Traits > Class Template Reference

#include <SocketMgr.h>

+ Inheritance diagram for Trinity::Net::SocketMgr< Traits >:

Public Types

using Self = typename Traits::Self
 
using SocketType = typename Traits::SocketType
 
using ThreadType = typename Traits::ThreadType
 

Public Member Functions

 SocketMgr (SocketMgr const &)=delete
 
 SocketMgr (SocketMgr &&)=delete
 
SocketMgroperator= (SocketMgr const &)=delete
 
SocketMgroperator= (SocketMgr &&)=delete
 
virtual ~SocketMgr ()
 
virtual bool StartNetwork (Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount)
 
virtual void StopNetwork ()
 
void Wait ()
 
virtual void OnSocketOpen (IoContextTcpSocket &&sock)
 
int32 GetNetworkThreadCount () const
 
Asio::IoContextSelectThreadWithMinConnections () const
 

Protected Member Functions

 SocketMgr ()
 
virtual std::unique_ptr< ThreadType[]> CreateThreads () const
 

Protected Attributes

std::unique_ptr< AsyncAcceptor_acceptor
 
std::unique_ptr< ThreadType[]> _threads
 
int32 _threadCount
 

Detailed Description

template<typename Traits>
class Trinity::Net::SocketMgr< Traits >

Definition at line 31 of file SocketMgr.h.

Member Typedef Documentation

◆ Self

template<typename Traits >
using Trinity::Net::SocketMgr< Traits >::Self = typename Traits::Self

Definition at line 34 of file SocketMgr.h.

◆ SocketType

template<typename Traits >
using Trinity::Net::SocketMgr< Traits >::SocketType = typename Traits::SocketType

Definition at line 35 of file SocketMgr.h.

◆ ThreadType

template<typename Traits >
using Trinity::Net::SocketMgr< Traits >::ThreadType = typename Traits::ThreadType

Definition at line 36 of file SocketMgr.h.

Constructor & Destructor Documentation

◆ SocketMgr() [1/3]

template<typename Traits >
Trinity::Net::SocketMgr< Traits >::SocketMgr ( SocketMgr< Traits > const &  )
delete

◆ SocketMgr() [2/3]

template<typename Traits >
Trinity::Net::SocketMgr< Traits >::SocketMgr ( SocketMgr< Traits > &&  )
delete

◆ ~SocketMgr()

template<typename Traits >
virtual Trinity::Net::SocketMgr< Traits >::~SocketMgr ( )
inlinevirtual

Definition at line 43 of file SocketMgr.h.

◆ SocketMgr() [3/3]

template<typename Traits >
Trinity::Net::SocketMgr< Traits >::SocketMgr ( )
inlineprotected

Definition at line 139 of file SocketMgr.h.

Member Function Documentation

◆ CreateThreads()

template<typename Traits >
virtual std::unique_ptr< ThreadType[]> Trinity::Net::SocketMgr< Traits >::CreateThreads ( ) const
inlineprotectedvirtual

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

Definition at line 143 of file SocketMgr.h.

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

◆ GetNetworkThreadCount()

template<typename Traits >
int32 Trinity::Net::SocketMgr< Traits >::GetNetworkThreadCount ( ) const
inline

Definition at line 125 of file SocketMgr.h.

+ Here is the caller graph for this function:

◆ OnSocketOpen()

template<typename Traits >
virtual void Trinity::Net::SocketMgr< Traits >::OnSocketOpen ( IoContextTcpSocket &&  sock)
inlinevirtual

Reimplemented in WorldSocketMgr.

Definition at line 105 of file SocketMgr.h.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename Traits >
SocketMgr & Trinity::Net::SocketMgr< Traits >::operator= ( SocketMgr< Traits > &&  )
delete

◆ operator=() [2/2]

template<typename Traits >
SocketMgr & Trinity::Net::SocketMgr< Traits >::operator= ( SocketMgr< Traits > const &  )
delete

◆ SelectThreadWithMinConnections()

template<typename Traits >
Asio::IoContext * Trinity::Net::SocketMgr< Traits >::SelectThreadWithMinConnections ( ) const
inline

Definition at line 127 of file SocketMgr.h.

+ Here is the caller graph for this function:

◆ StartNetwork()

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

Reimplemented in WorldSocketMgr.

Definition at line 48 of file SocketMgr.h.

+ Here is the call graph for this function:

◆ StopNetwork()

template<typename Traits >
virtual void Trinity::Net::SocketMgr< Traits >::StopNetwork ( )
inlinevirtual

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

Definition at line 85 of file SocketMgr.h.

+ Here is the call graph for this function:

◆ Wait()

template<typename Traits >
void Trinity::Net::SocketMgr< Traits >::Wait ( )
inline

Definition at line 99 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<typename Traits >
std::unique_ptr<AsyncAcceptor> Trinity::Net::SocketMgr< Traits >::_acceptor
protected

Definition at line 148 of file SocketMgr.h.

◆ _threadCount

template<typename Traits >
int32 Trinity::Net::SocketMgr< Traits >::_threadCount
protected

Definition at line 150 of file SocketMgr.h.

◆ _threads

template<typename Traits >
std::unique_ptr<ThreadType[]> Trinity::Net::SocketMgr< Traits >::_threads
protected

Definition at line 149 of file SocketMgr.h.


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