TrinityCore
|
Manages all sockets connected to peers and network threads. More...
#include <WorldSocketMgr.h>
Public Member Functions | |
~WorldSocketMgr () | |
bool | StartWorldNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, uint16 instancePort, 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 (boost::asio::ip::tcp::socket &&sock, uint32 threadIndex) override |
std::size_t | GetApplicationSendBufferSize () const |
Public Member Functions inherited from SocketMgr< WorldSocket > | |
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 *, 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 () | |
virtual NetworkThread< WorldSocket > * | CreateThreads () const=0 |
Private Types | |
typedef SocketMgr< WorldSocket > | BaseSocketMgr |
Private Member Functions | |
bool | StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount) override |
Private Attributes | |
AsyncAcceptor * | _instanceAcceptor |
int32 | _socketSystemSendBufferSize |
int32 | _socketApplicationSendBufferSize |
bool | _tcpNoDelay |
Additional Inherited Members | |
Protected Attributes inherited from SocketMgr< WorldSocket > | |
AsyncAcceptor * | _acceptor |
NetworkThread< WorldSocket > * | _threads |
int32 | _threadCount |
Manages all sockets connected to peers and network threads.
Definition at line 32 of file WorldSocketMgr.h.
|
private |
Definition at line 34 of file WorldSocketMgr.h.
WorldSocketMgr::~WorldSocketMgr | ( | ) |
Definition at line 49 of file WorldSocketMgr.cpp.
|
protected |
Definition at line 45 of file WorldSocketMgr.cpp.
|
overrideprotectedvirtual |
Implements SocketMgr< WorldSocket >.
Definition at line 154 of file WorldSocketMgr.cpp.
|
inline |
Definition at line 49 of file WorldSocketMgr.h.
|
static |
Definition at line 54 of file WorldSocketMgr.cpp.
|
overridevirtual |
Reimplemented from SocketMgr< WorldSocket >.
Definition at line 123 of file WorldSocketMgr.cpp.
|
inlineoverrideprivatevirtual |
Reimplemented from SocketMgr< WorldSocket >.
Definition at line 58 of file WorldSocketMgr.h.
bool WorldSocketMgr::StartWorldNetwork | ( | Trinity::Asio::IoContext & | ioContext, |
std::string const & | bindIp, | ||
uint16 | port, | ||
uint16 | instancePort, | ||
int | networkThreads | ||
) |
Start network, listen at address:port .
Definition at line 60 of file WorldSocketMgr.cpp.
|
overridevirtual |
Stops all network threads, It will wait for all running threads .
Reimplemented from SocketMgr< WorldSocket >.
Definition at line 110 of file WorldSocketMgr.cpp.
|
private |
Definition at line 63 of file WorldSocketMgr.h.
|
private |
Definition at line 65 of file WorldSocketMgr.h.
|
private |
Definition at line 64 of file WorldSocketMgr.h.
|
private |
Definition at line 66 of file WorldSocketMgr.h.