public void Ping(HostInfo info) { var host = Dns.GetHostEntry(info.Uri); IPEndPointCollection ips = new IPEndPointCollection(); host.AddressList?.ToList().ForEach(p => { ips.Add(new IPEndPoint(p, info.Port)); }); var peerInfo = new PeerEndPointInfo { LastUpdated = DateTime.UtcNow, PeerUri = info.Uri, PeerIpCollection = ips }; PeerEndPointInformation?.Invoke(info); }
public void Ping(HostInfo info) { var Host = Dns.GetHostEntry(info.Uri); IPEndPointCollection ips = new IPEndPointCollection(); //Console.WriteLine($"new peer entered peer endpoint details :"); Host.AddressList.ToList()?.ForEach(p => { ips.Add(new IEndPoint(p, info.Port)); });//Console.WriteLine($"\t \t \t Endpoint: {p}{Port}")); // Console.WriteLine($"yay ! from :{peerUri}"); var peerInfo = new PeerEndPointInfo { LastUpdate = DateTime.UtcNow, PeerUri = info.Uri, PeerIpColletion = ips }; PeerEndPointInformation?.Invoke(info); }