AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "NetworkThread.h"
Public Member Functions | |
NetworkThread () | |
virtual | ~NetworkThread () |
void | Stop () |
bool | Start () |
void | Wait () |
int32 | GetConnectionCount () const |
virtual void | AddSocket (std::shared_ptr< SocketType > sock) |
tcp::socket * | GetSocketForAccept () |
void | EnableProxyProtocol () |
Protected Member Functions | |
virtual void | SocketAdded (std::shared_ptr< SocketType >) |
virtual void | SocketRemoved (std::shared_ptr< SocketType >) |
void | AddNewSockets () |
void | HandleNewSocketsProxyReadingOnConnect () |
void | Run () |
void | Update () |
Private Types | |
using | SocketContainer = std::vector< std::shared_ptr< SocketType > > |
Private Attributes | |
std::atomic< int32 > | _connections {} |
std::atomic< bool > | _stopped {} |
std::unique_ptr< std::thread > | _thread |
SocketContainer | _sockets |
std::mutex | _newSocketsLock |
SocketContainer | _newSockets |
Acore::Asio::IoContext | _ioContext |
tcp::socket | _acceptSocket |
Acore::Asio::DeadlineTimer | _updateTimer |
bool | _proxyHeaderReadingEnabled |
|
private |
|
inline |
|
inlinevirtual |
References NetworkThread< SocketType >::_thread, NetworkThread< SocketType >::Stop(), and NetworkThread< SocketType >::Wait().
|
inlineprotected |
References NetworkThread< SocketType >::_connections, NetworkThread< SocketType >::_newSockets, NetworkThread< SocketType >::_newSocketsLock, NetworkThread< SocketType >::_proxyHeaderReadingEnabled, NetworkThread< SocketType >::_sockets, NetworkThread< SocketType >::HandleNewSocketsProxyReadingOnConnect(), and NetworkThread< SocketType >::SocketRemoved().
Referenced by NetworkThread< SocketType >::Update().
|
inlinevirtual |
References NetworkThread< SocketType >::_connections, NetworkThread< SocketType >::_newSockets, NetworkThread< SocketType >::_newSocketsLock, and NetworkThread< SocketType >::SocketAdded().
|
inline |
References NetworkThread< SocketType >::_proxyHeaderReadingEnabled.
Referenced by AuthSocketMgr::CreateThreads().
|
inline |
References NetworkThread< SocketType >::_connections.
|
inline |
References NetworkThread< SocketType >::_acceptSocket.
|
inlineprotected |
References NetworkThread< SocketType >::_connections, NetworkThread< SocketType >::_newSockets, NetworkThread< SocketType >::_sockets, PROXY_HEADER_READING_STATE_FINISHED, PROXY_HEADER_READING_STATE_NOT_STARTED, PROXY_HEADER_READING_STATE_STARTED, and NetworkThread< SocketType >::SocketRemoved().
Referenced by NetworkThread< SocketType >::AddNewSockets().
|
inlineprotected |
References NetworkThread< SocketType >::_ioContext, NetworkThread< SocketType >::_newSockets, NetworkThread< SocketType >::_sockets, NetworkThread< SocketType >::_updateTimer, LOG_DEBUG, Acore::Asio::IoContext::run(), and NetworkThread< SocketType >::Update().
Referenced by NetworkThread< SocketType >::Start().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Reimplemented in WorldSocketThread.
Referenced by NetworkThread< SocketType >::AddNewSockets(), and NetworkThread< SocketType >::HandleNewSocketsProxyReadingOnConnect().
|
inline |
References NetworkThread< SocketType >::_thread, and NetworkThread< SocketType >::Run().
|
inline |
References NetworkThread< SocketType >::_ioContext, NetworkThread< SocketType >::_stopped, and Acore::Asio::IoContext::stop().
Referenced by NetworkThread< SocketType >::~NetworkThread().
|
inlineprotected |
References NetworkThread< SocketType >::_sockets, NetworkThread< SocketType >::_stopped, NetworkThread< SocketType >::_updateTimer, NetworkThread< SocketType >::AddNewSockets(), and NetworkThread< SocketType >::Update().
Referenced by NetworkThread< SocketType >::Run(), and NetworkThread< SocketType >::Update().
|
inline |
References NetworkThread< SocketType >::_thread, and ASSERT.
Referenced by NetworkThread< SocketType >::~NetworkThread().
|
private |
Referenced by NetworkThread< SocketType >::GetSocketForAccept().
|
private |
|
private |
Referenced by NetworkThread< SocketType >::Run(), and NetworkThread< SocketType >::Stop().
|
private |
|
private |
Referenced by NetworkThread< SocketType >::AddNewSockets(), and NetworkThread< SocketType >::AddSocket().
|
private |
|
private |
|
private |
Referenced by NetworkThread< SocketType >::Stop(), and NetworkThread< SocketType >::Update().
|
private |
|
private |
Referenced by NetworkThread< SocketType >::Run(), and NetworkThread< SocketType >::Update().