diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index ed44ae4e30..dc348fb4a5 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -49,7 +49,7 @@ namespace OpenRA.Server public readonly MersenneTwister Random = new MersenneTwister(); public readonly ServerType Type; - public List Conns = new List(); + public readonly List Conns = new List(); public Session LobbyInfo; public ServerSettings Settings; @@ -392,6 +392,10 @@ namespace OpenRA.Server foreach (var t in serverTraits.WithInterface()) t.ServerShutdown(this); + // Make sure to immediately close connections after the server is shutdown, we don't want to keep clients waiting + foreach (var c in Conns) + c.Dispose(); + Conns.Clear(); }) { IsBackground = true }.Start();