mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff
* Based on work done by @dimiandre in PR #21173 Closes #21171 Closes #21173
This commit is contained in:
@@ -58,11 +58,11 @@ WorldSocketMgr& WorldSocketMgr::Instance()
|
||||
return instance;
|
||||
}
|
||||
|
||||
bool WorldSocketMgr::StartWorldNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, uint16 instancePort, int threadCount)
|
||||
bool WorldSocketMgr::StartWorldNetwork(Trinity::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port, uint16 instancePort, int threadCount)
|
||||
{
|
||||
_tcpNoDelay = sConfigMgr->GetBoolDefault("Network.TcpNodelay", true);
|
||||
|
||||
int const max_connections = boost::asio::socket_base::max_connections;
|
||||
int const max_connections = TRINITY_MAX_LISTEN_CONNECTIONS;
|
||||
TC_LOG_DEBUG("misc", "Max allowed socket connections %d", max_connections);
|
||||
|
||||
// -1 means use default
|
||||
@@ -76,13 +76,13 @@ bool WorldSocketMgr::StartWorldNetwork(boost::asio::io_service& service, std::st
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!BaseSocketMgr::StartNetwork(service, bindIp, port, threadCount))
|
||||
if (!BaseSocketMgr::StartNetwork(ioContext, bindIp, port, threadCount))
|
||||
return false;
|
||||
|
||||
AsyncAcceptor* instanceAcceptor = nullptr;
|
||||
try
|
||||
{
|
||||
instanceAcceptor = new AsyncAcceptor(service, bindIp, instancePort);
|
||||
instanceAcceptor = new AsyncAcceptor(ioContext, bindIp, instancePort);
|
||||
}
|
||||
catch (boost::system::system_error const& err)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user