#include <SocketMgr.h>
template<class SocketType>
int32 _threadCount
Definition: SocketMgr.h:130
AsyncAcceptor * _acceptor
Definition: SocketMgr.h:128
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
#define ASSERT
Definition: Errors.h:55
template<class SocketType>
int32 _threadCount
Definition: SocketMgr.h:130
AsyncAcceptor * _acceptor
Definition: SocketMgr.h:128
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
template<class SocketType>
template<class SocketType>
int32 _threadCount
Definition: SocketMgr.h:130
template<class SocketType>
std::pair<tcp::socket*, uint32> SocketMgr< SocketType >::GetSocketForAccept |
( |
| ) |
|
|
inline |
uint32 SelectThreadWithMinConnections() const
Definition: SocketMgr.h:104
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
uint32_t uint32
Definition: Define.h:150
std::pair< tcp::socket *, uint32 > GetSocketForAccept()
Definition: SocketMgr.h:115
template<class SocketType>
virtual void SocketMgr< SocketType >::OnSocketOpen |
( |
tcp::socket && |
sock, |
|
|
uint32 |
threadIndex |
|
) |
| |
|
inlinevirtual |
Reimplemented in WorldSocketMgr.
91 std::shared_ptr<SocketType> newSocket = std::make_shared<SocketType>(std::move(sock));
94 _threads[threadIndex].AddSocket(newSocket);
96 catch (boost::system::system_error
const& err)
98 TC_LOG_WARN(
"network",
"Failed to retrieve client's remote address %s", err.what());
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:204
template<class SocketType>
int32 _threadCount
Definition: SocketMgr.h:130
T min(const T &x, const T &y)
Definition: g3dmath.h:305
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
template<class SocketType>
virtual bool SocketMgr< SocketType >::StartNetwork |
( |
boost::asio::io_service & |
service, |
|
|
std::string const & |
bindIp, |
|
|
uint16 |
port, |
|
|
int |
threadCount |
|
) |
| |
|
inlinevirtual |
Reimplemented in WorldSocketMgr, and Battlenet::SessionManager.
46 catch (boost::system::system_error
const& err)
48 TC_LOG_ERROR(
"network",
"Exception caught in SocketMgr.StartNetwork (%s:%u): %s", bindIp.c_str(), port, err.what());
int32 _threadCount
Definition: SocketMgr.h:130
Definition: AsyncAcceptor.h:28
AsyncAcceptor * _acceptor
Definition: SocketMgr.h:128
virtual NetworkThread< SocketType > * CreateThreads() const =0
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
int32_t int32
Definition: Define.h:146
#define ASSERT
Definition: Errors.h:55
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
template<class SocketType>
virtual void SocketMgr< SocketType >::StopNetwork |
( |
| ) |
|
|
inlinevirtual |
Reimplemented in WorldSocketMgr.
void Wait()
Definition: SocketMgr.h:80
int32 _threadCount
Definition: SocketMgr.h:130
void Close()
Definition: AsyncAcceptor.h:69
AsyncAcceptor * _acceptor
Definition: SocketMgr.h:128
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
int32_t int32
Definition: Define.h:146
template<class SocketType>
void Wait()
Definition: SocketMgr.h:80
int32 _threadCount
Definition: SocketMgr.h:130
NetworkThread< SocketType > * _threads
Definition: SocketMgr.h:129
int32_t int32
Definition: Define.h:146
template<class SocketType>
template<class SocketType>
template<class SocketType>
The documentation for this class was generated from the following file: