public async Task <IEnumerable <INatDevice> > DiscoverAsync(CancellationToken cancel_token) { var devices = new List <NatPmpDevice>(); foreach (var gateway in GetGatewayAddresses()) { var dev = new NatPmpDevice(gateway); var external_address = await dev.GetExternalAddressAsync(cancel_token).ConfigureAwait(false); if (external_address != null) { devices.Add(dev); } } return(devices); }
public async Task<IEnumerable<INatDevice>> DiscoverAsync(CancellationToken cancel_token) { var devices = new List<NatPmpDevice>(); foreach (var gateway in GetGatewayAddresses()) { var dev = new NatPmpDevice(gateway); var external_address = await dev.GetExternalAddressAsync(cancel_token); if (external_address!=null) devices.Add(dev); } return devices; }