Esempio n. 1
0
        public static void DisposeClient(MemTcpClient client)
        {
            if (client == null)
            {
                return;
            }
            try
            {
                bool exists = false;

                lock (_clients)
                {
                    exists = _clients.Remove(client);
                }

                if (exists)
                {
                    client.LogManager.Info("NetworkGateway.DisposeClient()", "\tDisposing " + client.Protocol + "client");
                    client.Dispose();
                }
            }
            catch (Exception e)
            {
                LogManager.Logger.Fatal("NetworkGateway.DisposeClient()", "\tFailed to dispose MemTcpClient. " + e.Message);
            }
        }
Esempio n. 2
0
        public static void DisposeClient(MemTcpClient client)
        {
            if (client == null)
                return;
            try
            {
                bool exists = false;

                lock (_clients)
                {
                    exists = _clients.Remove(client);
                }

                if (exists)
                {
                    client.LogManager.Info("NetworkGateway.DisposeClient()","\tDisposing " + client.Protocol + "client");
                    client.Dispose();
                }
            }
            catch (Exception e)
            {
                LogManager.Logger.Fatal("NetworkGateway.DisposeClient()", "\tFailed to dispose MemTcpClient. " + e.Message);
            }
        }