TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Battlenet::SessionManager Class Reference

#include <SessionManager.h>

Public Member Functions

bool StartNetwork (boost::asio::io_service &service, std::string const &bindIp, uint16 port, int threadCount=1) override
 
- Public Member Functions inherited from SocketMgr< Session >
virtual ~SocketMgr ()
 
virtual void StopNetwork ()
 
void Wait ()
 
virtual void OnSocketOpen (tcp::socket &&sock, uint32 threadIndex)
 
int32 GetNetworkThreadCount () const
 
uint32 SelectThreadWithMinConnections () const
 
std::pair< tcp::socket *, uint32GetSocketForAccept ()
 

Static Public Member Functions

static SessionManagerInstance ()
 

Protected Member Functions

NetworkThread< Session > * CreateThreads () const override
 
- Protected Member Functions inherited from SocketMgr< Session >
 SocketMgr ()
 

Private Types

typedef SocketMgr< SessionBaseSocketMgr
 

Static Private Member Functions

static void OnSocketAccept (tcp::socket &&sock, uint32 threadIndex)
 

Additional Inherited Members

- Protected Attributes inherited from SocketMgr< Session >
AsyncAcceptor_acceptor
 
NetworkThread< Session > * _threads
 
int32 _threadCount
 

Member Typedef Documentation

Member Function Documentation

NetworkThread< Battlenet::Session > * Battlenet::SessionManager::CreateThreads ( ) const
overrideprotectedvirtual

Implements SocketMgr< Session >.

31 {
33 }
int32 GetNetworkThreadCount() const
Definition: SocketMgr.h:102
Battlenet::SessionManager & Battlenet::SessionManager::Instance ( )
static
41 {
42  static SessionManager instance;
43  return instance;
44 }
void Battlenet::SessionManager::OnSocketAccept ( tcp::socket &&  sock,
uint32  threadIndex 
)
staticprivate
36 {
37  sSessionMgr.OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
38 }
#define sSessionMgr
Definition: SessionManager.h:43

+ Here is the caller graph for this function:

bool Battlenet::SessionManager::StartNetwork ( boost::asio::io_service &  service,
std::string const bindIp,
uint16  port,
int  threadCount = 1 
)
overridevirtual

Reimplemented from SocketMgr< Session >.

21 {
22  if (!BaseSocketMgr::StartNetwork(service, bindIp, port, threadCount))
23  return false;
24 
27  return true;
28 }
virtual bool StartNetwork(boost::asio::io_service &service, std::string const &bindIp, uint16 port, int threadCount)
Definition: SocketMgr.h:38
AsyncAcceptor * _acceptor
Definition: SocketMgr.h:128
void SetSocketFactory(std::function< std::pair< tcp::socket *, uint32 >()> func)
Definition: AsyncAcceptor.h:78
static void OnSocketAccept(tcp::socket &&sock, uint32 threadIndex)
Definition: SessionManager.cpp:35
std::pair< tcp::socket *, uint32 > GetSocketForAccept()
Definition: SocketMgr.h:115
void AsyncAcceptWithCallback()
Definition: AsyncAcceptor.h:43

+ Here is the call graph for this function:


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