Esempio n. 1
0
        private void CloseMatches(string Reason)
        {
            if (Matches == null)
            {
                return;
            }

            foreach (Connection Match in Matches.ToList <Connection>())
            {
                if (Match.Matches.Count > 0)
                {
                    Match.Matches.Remove(GUID);
                }
                if (Match.Matches.Count == 0)
                {
                    Match.Close(Reason);
                }
            }

            Matches.Clear();
        }
Esempio n. 2
0
        public void Close(string Reason)
        {
            if (isClosed)
            {
                return;
            }

            isClosed = true;

            foreach (Connection Ctx in Clients) // Client first
            {
                Remove(Ctx, "Server is closing: " + Reason, false);
            }

            Keys.Clear();
            Clients.Clear();

            Keys    = null;
            Clients = null;

            iServer.Close(Reason);
        }