feat(Core/Socket): make world OnSocketAccept like auth (#8946)

This commit is contained in:
Kargatum
2021-11-04 18:42:34 +01:00
committed by GitHub
parent 8ac01da463
commit 21214d12c8
2 changed files with 6 additions and 6 deletions
+1 -6
View File
@@ -22,11 +22,6 @@
#include "WorldSocketMgr.h"
#include <boost/system/error_code.hpp>
static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)
{
sWorldSocketMgr.OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
}
class WorldSocketThread : public NetworkThread<WorldSocket>
{
public:
@@ -73,7 +68,7 @@ bool WorldSocketMgr::StartWorldNetwork(Acore::Asio::IoContext& ioContext, std::s
if (!BaseSocketMgr::StartNetwork(ioContext, bindIp, port, threadCount))
return false;
_acceptor->AsyncAcceptWithCallback<&OnSocketAccept>();
_acceptor->AsyncAcceptWithCallback<&WorldSocketMgr::OnSocketAccept>();
sScriptMgr->OnNetworkStart();
return true;
+5
View File
@@ -50,6 +50,11 @@ protected:
NetworkThread<WorldSocket>* CreateThreads() const override;
static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)
{
Instance().OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
}
private:
int32 _socketSystemSendBufferSize;
int32 _socketApplicationSendBufferSize;