mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Bnetserver: Catch and log an exception that happens when WorldserverListenPort is already used
Closes #15284
This commit is contained in:
@@ -63,9 +63,18 @@ void WorldListener::Run()
|
||||
|
||||
void WorldListener::HandleOpen()
|
||||
{
|
||||
_worldSocket->bind(std::string("tcp://*:") + std::to_string(_worldListenPort));
|
||||
try
|
||||
{
|
||||
_worldSocket->bind(std::string("tcp://*:") + std::to_string(_worldListenPort));
|
||||
}
|
||||
catch (zmqpp::zmq_internal_exception& ex)
|
||||
{
|
||||
TC_LOG_FATAL("server.ipc", "Could not bind to WorldserverListenPort %u. Exception: %s. Shutting down bnetserver.", _worldListenPort, ex.what());
|
||||
abort();
|
||||
}
|
||||
|
||||
_poller->add(*_worldSocket);
|
||||
TC_LOG_INFO("server.ipc", "Listening on connections from worldservers...");
|
||||
TC_LOG_INFO("server.ipc", "Listening on connections from worldservers on port %u...", _worldListenPort);
|
||||
}
|
||||
|
||||
void WorldListener::HandleClose()
|
||||
|
||||
Reference in New Issue
Block a user