From 05210c2a34146c9dcf50d30f6db6ad5fc0db7229 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 18 Jan 2019 17:58:24 +0100 Subject: Core/Misc: Fix shutdown with SOAP enabled Fix worldserver entering a loop when having SOAP enabled but failing to bind both SOAP and worldserver listened socket. SOAP thread would keep trying to bind the socket over and over checking World::IsStopped() condition that was never set to true (cherry picked from commit 85e3169fbd7b2da70e0f054399f4db64ded36325) --- src/server/worldserver/Main.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/server/worldserver/Main.cpp') diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index f8f62233bf7..dfc1e5a4e1f 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -273,18 +273,6 @@ extern int main(int argc, char** argv) if (sConfigMgr->GetBoolDefault("Ra.Enable", false)) raAcceptor.reset(StartRaSocketAcceptor(*ioContext)); - // Start soap serving thread if enabled - std::shared_ptr soapThread; - if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false)) - { - soapThread.reset(new std::thread(TCSoapThread, sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878))), - [](std::thread* thr) - { - thr->join(); - delete thr; - }); - } - // Launch the worldserver listener socket uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD)); uint16 instancePort = uint16(sWorld->getIntConfig(CONFIG_PORT_INSTANCE)); @@ -315,6 +303,18 @@ extern int main(int argc, char** argv) ClearOnlineAccounts(); }); + // Start soap serving thread if enabled + std::shared_ptr soapThread; + if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false)) + { + soapThread.reset(new std::thread(TCSoapThread, sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878))), + [](std::thread* thr) + { + thr->join(); + delete thr; + }); + } + // Launch CliRunnable thread std::shared_ptr cliThread; #ifdef _WIN32 -- cgit v1.2.3