TrinityCore
Loading...
Searching...
No Matches
WorldSocketMgr Class Referencefinal

Manages all sockets connected to peers and network threads. More...

#include <WorldSocketMgr.h>

+ Inheritance diagram for WorldSocketMgr:

Public Member Functions

 ~WorldSocketMgr ()
 
bool StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount) override
 Start network, listen at address:port .
 
void StopNetwork () override
 Stops all network threads, It will wait for all running threads .
 
void OnSocketOpen (Trinity::Net::IoContextTcpSocket &&sock) override
 
std::size_t GetApplicationSendBufferSize () const
 
- Public Member Functions inherited from Trinity::Net::SocketMgr< WorldSocketMgrTraits >
 SocketMgr (SocketMgr const &)=delete
 
 SocketMgr (SocketMgr &&)=delete
 
SocketMgroperator= (SocketMgr const &)=delete
 
SocketMgroperator= (SocketMgr &&)=delete
 
virtual ~SocketMgr ()
 
void Wait ()
 
int32 GetNetworkThreadCount () const
 
Asio::IoContextSelectThreadWithMinConnections () const
 

Static Public Member Functions

static WorldSocketMgrInstance ()
 

Protected Member Functions

 WorldSocketMgr ()
 
- Protected Member Functions inherited from Trinity::Net::SocketMgr< WorldSocketMgrTraits >
 SocketMgr ()
 
virtual std::unique_ptr< ThreadType[]> CreateThreads () const
 

Private Attributes

int32 _socketSystemSendBufferSize
 
int32 _socketApplicationSendBufferSize
 
bool _tcpNoDelay
 

Additional Inherited Members

- Public Types inherited from Trinity::Net::SocketMgr< WorldSocketMgrTraits >
using Self = typename Traits::Self
 
using SocketType = typename Traits::SocketType
 
using ThreadType = typename Traits::ThreadType
 
- Protected Attributes inherited from Trinity::Net::SocketMgr< WorldSocketMgrTraits >
std::unique_ptr< AsyncAcceptor_acceptor
 
std::unique_ptr< ThreadType[]> _threads
 
int32 _threadCount
 

Detailed Description

Manages all sockets connected to peers and network threads.

Definition at line 42 of file WorldSocketMgr.h.

Constructor & Destructor Documentation

◆ ~WorldSocketMgr()

WorldSocketMgr::~WorldSocketMgr ( )
default

◆ WorldSocketMgr()

WorldSocketMgr::WorldSocketMgr ( )
protected

Definition at line 34 of file WorldSocketMgr.cpp.

Member Function Documentation

◆ GetApplicationSendBufferSize()

std::size_t WorldSocketMgr::GetApplicationSendBufferSize ( ) const
inline

Definition at line 57 of file WorldSocketMgr.h.

◆ Instance()

WorldSocketMgr & WorldSocketMgr::Instance ( )
static

Definition at line 40 of file WorldSocketMgr.cpp.

◆ OnSocketOpen()

void WorldSocketMgr::OnSocketOpen ( Trinity::Net::IoContextTcpSocket &&  sock)
overridevirtual

Reimplemented from Trinity::Net::SocketMgr< WorldSocketMgrTraits >.

Definition at line 78 of file WorldSocketMgr.cpp.

◆ StartNetwork()

bool WorldSocketMgr::StartNetwork ( Trinity::Asio::IoContext ioContext,
std::string const &  bindIp,
uint16  port,
int  threadCount 
)
overridevirtual

Start network, listen at address:port .

Reimplemented from Trinity::Net::SocketMgr< WorldSocketMgrTraits >.

Definition at line 46 of file WorldSocketMgr.cpp.

◆ StopNetwork()

void WorldSocketMgr::StopNetwork ( )
overridevirtual

Stops all network threads, It will wait for all running threads .

Reimplemented from Trinity::Net::SocketMgr< WorldSocketMgrTraits >.

Definition at line 71 of file WorldSocketMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _socketApplicationSendBufferSize

int32 WorldSocketMgr::_socketApplicationSendBufferSize
private

Definition at line 64 of file WorldSocketMgr.h.

◆ _socketSystemSendBufferSize

int32 WorldSocketMgr::_socketSystemSendBufferSize
private

Definition at line 63 of file WorldSocketMgr.h.

◆ _tcpNoDelay

bool WorldSocketMgr::_tcpNoDelay
private

Definition at line 65 of file WorldSocketMgr.h.


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