public async Task <List <DiscoveredSsdpDevice> > Search() { deviceLocator = new SsdpDeviceLocator(); try { var foundDevices = deviceLocator.SearchAsync().Result.ToList(); if (foundDevices.Count > 0) { foreach (var device in foundDevices) { SsdpDevice info = await device.GetDeviceInfo().ConfigureAwait(false); var objs = new List <object> { device, info }; var foundDevice = auow.BuildObject <FoundDevice, List <object> >(objs); auow.Commit(foundDevice); } } return(foundDevices.ToList()); } catch (SocketException ex) { Console.WriteLine(ex.Message); throw; } }
public SsdpFinder() { Uow = new RssdpUow(); deviceLocator = new SsdpDeviceLocator(); deviceLocator.DeviceAvailable += DeviceLocator_DeviceAvailable; }
public UpnpSearcher() { deviceLocator = new SsdpDeviceLocator(); deviceLocator.DeviceAvailable += DeviceLocator_DeviceAvailable; auow = new UpnpUow(); }