aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/authserver/Main.cpp')
-rw-r--r--src/server/authserver/Main.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index d1b2b614037..0e23dd99ba8 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -151,7 +151,8 @@ extern int main(int argc, char** argv)
}
// Launch the listening network socket
- RealmAcceptor acceptor;
+ RealmAcceptor<AuthSocket> acceptor;
+ RealmAcceptor<Battlenet::Socket> bnetacceptor;
int32 rmport = sConfigMgr->GetIntDefault("RealmServerPort", 3724);
if (rmport < 0 || rmport > 0xFFFF)
@@ -170,6 +171,13 @@ extern int main(int argc, char** argv)
return 1;
}
+ bind_addr.set_port_number(1119);
+ if (bnetacceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1)
+ {
+ TC_LOG_ERROR("server.authserver", "Auth server can not bind to %s:%d", bind_ip.c_str(), 1119);
+ return 1;
+ }
+
// Initialize the signal handlers
AuthServerSignalHandler SignalINT, SignalTERM;
@@ -179,24 +187,24 @@ extern int main(int argc, char** argv)
Handler.register_handler(SIGTERM, &SignalTERM);
#if defined(_WIN32) || defined(__linux__)
-
+
///- Handle affinity for multiple processors and process priority
uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0);
bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false);
#ifdef _WIN32 // Windows
-
+
HANDLE hProcess = GetCurrentProcess();
if (affinity > 0)
{
ULONG_PTR appAff;
ULONG_PTR sysAff;
-
+
if (GetProcessAffinityMask(hProcess, &appAff, &sysAff))
{
// remove non accessible processors
ULONG_PTR currentAffinity = affinity & appAff;
-
+
if (!currentAffinity)
TC_LOG_ERROR("server.authserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the authserver. Accessible processors bitmask (hex): %x", affinity, appAff);
else if (SetProcessAffinityMask(hProcess, currentAffinity))
@@ -205,7 +213,7 @@ extern int main(int argc, char** argv)
TC_LOG_ERROR("server.authserver", "Can't set used processors (hex): %x", currentAffinity);
}
}
-
+
if (highPriority)
{
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
@@ -213,9 +221,9 @@ extern int main(int argc, char** argv)
else
TC_LOG_ERROR("server.authserver", "Can't set authserver process priority class.");
}
-
+
#else // Linux
-
+
if (affinity > 0)
{
cpu_set_t mask;
@@ -242,7 +250,7 @@ extern int main(int argc, char** argv)
else
TC_LOG_INFO("server.authserver", "authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0));
}
-
+
#endif
#endif