Fix announce thread exception

This commit is contained in:
Sardelka
2022-08-02 15:55:26 +08:00
parent cb1b4f4970
commit 5a882d0bc8
2 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,7 @@ namespace RageCoop.Server
server.Stop(); server.Stop();
mainLogger.Info("Server stopped."); mainLogger.Info("Server stopped.");
mainLogger.Dispose(); mainLogger.Dispose();
Thread.Sleep(3000); Thread.Sleep(1000);
Environment.Exit(0); Environment.Exit(0);
} }
else else

View File

@ -246,8 +246,11 @@ namespace RageCoop.Server
_stopping = true; _stopping = true;
Logger?.Flush(); Logger?.Flush();
_listenerThread.Join(); _listenerThread.Join();
_announceThread.Join();
_latencyThread.Join(); _latencyThread.Join();
if (_announceThread.IsAlive)
{
_announceThread.Join();
}
_worker.Dispose(); _worker.Dispose();
} }
private void Listen() private void Listen()