diff options
Diffstat (limited to 'src/Server.cpp')
-rw-r--r-- | src/Server.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index 367d507bf..42ad133f1 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -222,12 +222,14 @@ bool cServer::InitServer(cIniFile & a_SettingsIni) bool HasAnyPorts = false; AString Ports = a_SettingsIni.GetValueSet("Server", "Port", "25565"); + m_ListenThreadIPv4.SetReuseAddr(true); if (m_ListenThreadIPv4.Initialize(Ports)) { HasAnyPorts = true; } Ports = a_SettingsIni.GetValueSet("Server", "PortsIPv6", "25565"); + m_ListenThreadIPv6.SetReuseAddr(true); if (m_ListenThreadIPv6.Initialize(Ports)) { HasAnyPorts = true; @@ -396,7 +398,7 @@ void cServer::TickClients(float a_Dt) { if ((*itr)->IsDestroyed()) { - // Remove the client later, when CS is not held, to avoid deadlock ( http://forum.mc-server.org/showthread.php?tid=374 ) + // Remove the client later, when CS is not held, to avoid deadlock: http://forum.mc-server.org/showthread.php?tid=374 RemoveClients.push_back(*itr); itr = m_Clients.erase(itr); continue; @@ -629,7 +631,7 @@ void cServer::Shutdown(void) cRoot::Get()->SaveAllChunks(); cCSLock Lock(m_CSClients); - for( ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr ) + for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr) { (*itr)->Destroy(); delete *itr; |