|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
Manages all sockets connected to peers and network threads. More...
#include <WorldSocketMgr.h>
Public Member Functions | |
| int | StartNetwork (uint16 port, const char *address) |
| Start network, listen at address:port . | |
| void | StopNetwork () |
| Stops all network threads, It will wait for all running threads . | |
| void | Wait () |
| Wait untill all network threads have "joined" . | |
Private Member Functions | |
| boost::asio::io_context & | GetNetworkIoContext (ReactorRunnable *reactor) |
| int | OnSocketOpen (WorldSocket *sock, ReactorRunnable *reactor) |
| ReactorRunnable * | SelectNetworkThread () |
| int | StartReactiveIO (uint16 port, const char *address) |
| WorldSocketMgr () | |
| virtual | ~WorldSocketMgr () |
Private Attributes | |
| class WorldSocketAcceptor * | m_Acceptor |
| ReactorRunnable * | m_NetThreads |
| size_t | m_NetThreadsCount |
| int | m_SockOutKBuff |
| int | m_SockOutUBuff |
| bool | m_UseNoDelay |
Friends | |
| class | Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex > |
| class | WorldSocket |
| class | WorldSocketAcceptor |
Manages all sockets connected to peers and network threads.
Definition at line 23 of file WorldSocketMgr.h.
|
private |
Definition at line 155 of file WorldSocketMgr.cpp.
References m_Acceptor, m_NetThreads, m_NetThreadsCount, m_SockOutKBuff, m_SockOutUBuff, and m_UseNoDelay.
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
|
private |
Definition at line 321 of file WorldSocketMgr.cpp.
References ReactorRunnable::GetIoContext().
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
|
private |
Definition at line 272 of file WorldSocketMgr.cpp.
References ReactorRunnable::AddSocket(), WorldSocket::Initialize(), WorldSocket::m_OutBufferSize, WorldSocket::m_Socket, m_SockOutKBuff, m_SockOutUBuff, m_UseNoDelay, SF_LOG_ERROR, and WorldSocket.
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
|
private |
Definition at line 307 of file WorldSocketMgr.cpp.
References ASSERT, m_NetThreads, and m_NetThreadsCount.
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
| int WorldSocketMgr::StartNetwork | ( | uint16 | port, |
| const char * | address ) |
Start network, listen at address:port .
Definition at line 232 of file WorldSocketMgr.cpp.
References sScriptMgr, and StartReactiveIO().
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
|
private |
Definition at line 170 of file WorldSocketMgr.cpp.
References m_Acceptor, m_NetThreads, m_NetThreadsCount, m_SockOutKBuff, m_SockOutUBuff, m_UseNoDelay, sConfigMgr, SF_LOG_ERROR, Wait(), and WorldSocketAcceptor.
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >, and StartNetwork().
| void WorldSocketMgr::StopNetwork | ( | ) |
Stops all network threads, It will wait for all running threads .
Definition at line 243 of file WorldSocketMgr.cpp.
References m_Acceptor, m_NetThreads, m_NetThreadsCount, sScriptMgr, and Wait().
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >.
| void WorldSocketMgr::Wait | ( | ) |
Wait untill all network threads have "joined" .
Definition at line 262 of file WorldSocketMgr.cpp.
References m_NetThreads, m_NetThreadsCount, and Wait().
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >, StartReactiveIO(), StopNetwork(), and Wait().
|
privatevirtual |
Definition at line 163 of file WorldSocketMgr.cpp.
References m_Acceptor, and m_NetThreads.
|
friend |
Definition at line 27 of file WorldSocketMgr.h.
References GetNetworkIoContext(), OnSocketOpen(), SelectNetworkThread(), StartNetwork(), StartReactiveIO(), StopNetwork(), Wait(), WorldSocketAcceptor, and WorldSocketMgr().
|
friend |
Definition at line 26 of file WorldSocketMgr.h.
References WorldSocket.
Referenced by OnSocketOpen(), and WorldSocket.
|
friend |
Definition at line 27 of file WorldSocketMgr.h.
Referenced by Skyfire::Singleton< WorldSocketMgr, Skyfire::Mutex >, and StartReactiveIO().
|
private |
Definition at line 57 of file WorldSocketMgr.h.
Referenced by StartReactiveIO(), StopNetwork(), WorldSocketMgr(), and ~WorldSocketMgr().
|
private |
Definition at line 50 of file WorldSocketMgr.h.
Referenced by SelectNetworkThread(), StartReactiveIO(), StopNetwork(), Wait(), WorldSocketMgr(), and ~WorldSocketMgr().
|
private |
Definition at line 51 of file WorldSocketMgr.h.
Referenced by SelectNetworkThread(), StartReactiveIO(), StopNetwork(), Wait(), and WorldSocketMgr().
|
private |
Definition at line 53 of file WorldSocketMgr.h.
Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().
|
private |
Definition at line 54 of file WorldSocketMgr.h.
Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().
|
private |
Definition at line 55 of file WorldSocketMgr.h.
Referenced by OnSocketOpen(), StartReactiveIO(), and WorldSocketMgr().