AcManager.Tools.Helpers.Api.KunosApiProvider.TryToGetLanList C# (CSharp) Метод

TryToGetLanList() публичный статический Метод

public static TryToGetLanList ( Action foundCallback, IEnumerable ports ) : void
foundCallback Action
ports IEnumerable
Результат void
        public static void TryToGetLanList(Action<ServerInformation> foundCallback, IEnumerable<int> ports) {
            Parallel.ForEach(
                    GetBroadcastAddresses()
                    .SelectMany(x => ports.Select(y => new {
                        BroadcastIp = x,
                        Port = y
                    })),
                    (entry, ipLoopState) => {
                        var found = BroadcastPing(entry.BroadcastIp, entry.Port);
                        if (found == null) return;

                        try {
                            var information = TryToGetInformationDirect(found.Ip, found.Port);
                            if (information == null) return;

                            information.IsLan = true;
                            Application.Current.Dispatcher.InvokeAsync(() => foundCallback(information));
                        } catch (Exception e) {
                            Logging.Write("[LAN SERVERS] Error: " + e);
                        }
                    });
        }

Same methods

KunosApiProvider::TryToGetLanList ( ) : AcManager.Tools.Helpers.Api.Kunos.ServerInformation[]
KunosApiProvider::TryToGetLanList ( IEnumerable ports ) : AcManager.Tools.Helpers.Api.Kunos.ServerInformation[]
KunosApiProvider::TryToGetLanList ( Action foundCallback ) : void