IrcD.Server.Settings.GetPorts C# (CSharp) Method

GetPorts() private method

private GetPorts ( ) : List
return List
        private List<int> GetPorts()
        {
            List<int> result = new List<int>();
            foreach (var iface in _configFile.Descendants("interface"))
            {
                if (iface.Element("port") != null)
                {
                    int port;
                    if (int.TryParse(iface.Element("port")?.Value, out port))
                    {
                        result.Add(port);
                    }
                }
            }

            if (!result.Any())
            {
                result.Add(6667);
            }

            return result;
        }