AzerothCore 3.3.5a
OpenSource WoW Emulator
|
Manages all sockets connected to peers and network threads. More...
#include "WorldSocketMgr.h"
Public Member Functions | |
bool | StartWorldNetwork (Acore::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int networkThreads) |
Start network, listen at address:port . More... | |
void | StopNetwork () override |
Stops all network threads, It will wait for all running threads . More... | |
void | OnSocketOpen (tcp::socket &&sock, uint32 threadIndex) override |
std::size_t | GetApplicationSendBufferSize () const |
Public Member Functions inherited from SocketMgr< WorldSocket > | |
virtual | ~SocketMgr () |
virtual bool | StartNetwork (Acore::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount) |
virtual void | StopNetwork () |
void | Wait () |
virtual void | OnSocketOpen (tcp::socket &&sock, uint32 threadIndex) |
int32 | GetNetworkThreadCount () const |
uint32 | SelectThreadWithMinConnections () const |
std::pair< tcp::socket *, uint32 > | GetSocketForAccept () |
Static Public Member Functions | |
static WorldSocketMgr & | Instance () |
Protected Member Functions | |
WorldSocketMgr () | |
NetworkThread< WorldSocket > * | CreateThreads () const override |
Protected Member Functions inherited from SocketMgr< WorldSocket > | |
SocketMgr ()=default | |
virtual NetworkThread< WorldSocket > * | CreateThreads () const=0 |
Static Protected Member Functions | |
static void | OnSocketAccept (tcp::socket &&sock, uint32 threadIndex) |
Private Types | |
typedef SocketMgr< WorldSocket > | BaseSocketMgr |
Private Attributes | |
int32 | _socketSystemSendBufferSize |
int32 | _socketApplicationSendBufferSize |
bool | _tcpNoDelay |
Additional Inherited Members | |
Protected Attributes inherited from SocketMgr< WorldSocket > | |
std::unique_ptr< AsyncAcceptor > | _acceptor |
std::unique_ptr< NetworkThread< WorldSocket >[]> | _threads |
int32 | _threadCount |
Manages all sockets connected to peers and network threads.
|
private |
|
protected |
|
overrideprotectedvirtual |
Implements SocketMgr< WorldSocket >.
References SocketMgr< WorldSocket >::GetNetworkThreadCount(), and sConfigMgr.
|
inline |
|
static |
|
inlinestaticprotected |
References Instance.
Referenced by StartWorldNetwork().
|
overridevirtual |
Reimplemented from SocketMgr< WorldSocket >.
References _socketSystemSendBufferSize, _tcpNoDelay, LOG_ERROR, and SocketMgr< WorldSocket >::OnSocketOpen().
bool WorldSocketMgr::StartWorldNetwork | ( | Acore::Asio::IoContext & | ioContext, |
std::string const & | bindIp, | ||
uint16 | port, | ||
int | networkThreads | ||
) |
Start network, listen at address:port .
References SocketMgr< WorldSocket >::_acceptor, _socketApplicationSendBufferSize, _socketSystemSendBufferSize, _tcpNoDelay, ACORE_MAX_LISTEN_CONNECTIONS, LOG_DEBUG, LOG_ERROR, OnSocketAccept(), sConfigMgr, sScriptMgr, and SocketMgr< WorldSocket >::StartNetwork().
|
overridevirtual |
Stops all network threads, It will wait for all running threads .
Reimplemented from SocketMgr< WorldSocket >.
References sScriptMgr, and SocketMgr< WorldSocket >::StopNetwork().
|
private |
Referenced by StartWorldNetwork().
|
private |
Referenced by OnSocketOpen(), and StartWorldNetwork().
|
private |
Referenced by OnSocketOpen(), and StartWorldNetwork().