![]() |
TrinityCore
|
#include <SocketMgr.h>
Public Member Functions | |
| SocketMgr (SocketMgr const &)=delete | |
| SocketMgr (SocketMgr &&)=delete | |
| SocketMgr & | operator= (SocketMgr const &)=delete |
| SocketMgr & | operator= (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, uint32 threadIndex) |
| int32 | GetNetworkThreadCount () const |
| uint32 | SelectThreadWithMinConnections () const |
| std::pair< IoContextTcpSocket *, uint32 > | GetSocketForAccept () |
Protected Member Functions | |
| SocketMgr () | |
| virtual NetworkThread< SocketType > * | CreateThreads () const =0 |
Protected Attributes | |
| std::unique_ptr< AsyncAcceptor > | _acceptor |
| std::unique_ptr< NetworkThread< SocketType >[]> | _threads |
| int32 | _threadCount |
Definition at line 31 of file SocketMgr.h.
|
delete |
|
delete |
|
inlinevirtual |
Definition at line 39 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_acceptor, Trinity::Net::SocketMgr< SocketType >::_threadCount, Trinity::Net::SocketMgr< SocketType >::_threads, and ASSERT.
|
inlineprotected |
Definition at line 134 of file SocketMgr.h.
|
protectedpure virtual |
Implemented in AuthSocketMgr, and WorldSocketMgr.
Referenced by Trinity::Net::SocketMgr< SocketType >::StartNetwork().
|
inline |
Definition at line 114 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_threadCount.
|
inline |
Definition at line 127 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_threads, Trinity::Net::SocketMgr< SocketType >::GetSocketForAccept(), and Trinity::Net::SocketMgr< SocketType >::SelectThreadWithMinConnections().
Referenced by Trinity::Net::SocketMgr< SocketType >::GetSocketForAccept(), and Trinity::Net::SocketMgr< SocketType >::StartNetwork().
|
inlinevirtual |
Reimplemented in WorldSocketMgr.
Definition at line 99 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_threads, and TC_LOG_WARN.
|
delete |
|
delete |
|
inline |
Definition at line 116 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_threadCount, and Trinity::Net::SocketMgr< SocketType >::_threads.
Referenced by Trinity::Net::SocketMgr< SocketType >::GetSocketForAccept().
|
inlinevirtual |
Reimplemented in AuthSocketMgr.
Definition at line 44 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_acceptor, Trinity::Net::SocketMgr< SocketType >::_threadCount, Trinity::Net::SocketMgr< SocketType >::_threads, ASSERT, Trinity::Net::SocketMgr< SocketType >::CreateThreads(), Trinity::Net::SocketMgr< SocketType >::GetSocketForAccept(), and TC_LOG_ERROR.
|
inlinevirtual |
Reimplemented in WorldSocketMgr.
Definition at line 79 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_acceptor, Trinity::Net::SocketMgr< SocketType >::_threadCount, Trinity::Net::SocketMgr< SocketType >::_threads, Trinity::Net::Stop, and Trinity::Net::SocketMgr< SocketType >::Wait().
|
inline |
Definition at line 93 of file SocketMgr.h.
References Trinity::Net::SocketMgr< SocketType >::_threadCount, Trinity::Net::SocketMgr< SocketType >::_threads, and Trinity::Net::SocketMgr< SocketType >::Wait().
Referenced by Trinity::Net::SocketMgr< SocketType >::StopNetwork(), and Trinity::Net::SocketMgr< SocketType >::Wait().
|
protected |
Definition at line 140 of file SocketMgr.h.
Referenced by Trinity::Net::SocketMgr< SocketType >::StartNetwork(), Trinity::Net::SocketMgr< SocketType >::StopNetwork(), and Trinity::Net::SocketMgr< SocketType >::~SocketMgr().
|
protected |
Definition at line 142 of file SocketMgr.h.
Referenced by Trinity::Net::SocketMgr< SocketType >::GetNetworkThreadCount(), Trinity::Net::SocketMgr< SocketType >::SelectThreadWithMinConnections(), Trinity::Net::SocketMgr< SocketType >::StartNetwork(), Trinity::Net::SocketMgr< SocketType >::StopNetwork(), Trinity::Net::SocketMgr< SocketType >::Wait(), and Trinity::Net::SocketMgr< SocketType >::~SocketMgr().
|
protected |
Definition at line 141 of file SocketMgr.h.
Referenced by Trinity::Net::SocketMgr< SocketType >::GetSocketForAccept(), Trinity::Net::SocketMgr< SocketType >::OnSocketOpen(), Trinity::Net::SocketMgr< SocketType >::SelectThreadWithMinConnections(), Trinity::Net::SocketMgr< SocketType >::StartNetwork(), Trinity::Net::SocketMgr< SocketType >::StopNetwork(), Trinity::Net::SocketMgr< SocketType >::Wait(), and Trinity::Net::SocketMgr< SocketType >::~SocketMgr().