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:
Shauren
2018-01-06 01:21:59 +01:00
parent 76577ddc3c
commit dfd2660a85
33 changed files with 474 additions and 190 deletions
+4 -4
View File
@@ -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)
{