aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-01-18 17:58:24 +0100
committerjackpoz <giacomopoz@gmail.com>2019-01-18 17:58:24 +0100
commit85e3169fbd7b2da70e0f054399f4db64ded36325 (patch)
tree3f6d604a592bf8a9dfaecca8a3dfda1235f51130
parent0cbdbd8a3f3c3b1160c34fae3d7daeacefa609d3 (diff)
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
-rw-r--r--src/server/worldserver/Main.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 5b328833405..aad966fbc36 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -261,18 +261,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<std::thread> 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));
std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
@@ -302,6 +290,18 @@ extern int main(int argc, char** argv)
ClearOnlineAccounts();
});
+ // Start soap serving thread if enabled
+ std::shared_ptr<std::thread> 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<std::thread> cliThread;
#ifdef _WIN32