private void FormDevices_Load(object sender, EventArgs e) { try { // create discovery system iListenerNotify = new SsdpListenerMulticast(); // create device lists iDeviceListJukebox = new DeviceListUpnp(ServiceJukebox.ServiceType(1), iListenerNotify); // hook in to discovery events iDeviceListJukebox.EventDeviceAdded += DeviceAlive; iDeviceListJukebox.EventDeviceRemoved += DeviceByeBye; NetworkInfoModel iface = iHelper.Interface.Interface.Info; if (iface != null) { // start discovery process iListenerNotify.Start(iface.IPAddress); iDeviceListJukebox.Start(iface.IPAddress); // improve discovery process iDeviceListJukebox.Rescan(); } else { DiscoveryFailed("Device discovery failed: no valid network interface card selected"); } } catch (Linn.Network.NetworkError ne) { DiscoveryFailed("NetworkError on device discovery: " + ne.Message); } catch (Exception exc) { DiscoveryFailed("Error on device discovery: " + exc.Message); } }
public Form1(AppKinskyWinForm aApp) { InitializeComponent(); iApp = aApp; iEventServer = new EventServerUpnp(); iSsdpListener = new SsdpListenerMulticast(); IMediaProviderSupportV6 support = new MediaProviderSupport(new AppSupport(aApp, iEventServer, iSsdpListener), new ViewSupport(), new PlaylistSupport(), new ArtworkCache(ArtworkCache.ECacheSize.eSmall)); MediaProviderLibraryFactory factory = new MediaProviderLibraryFactory(); iLibrary = factory.Create(support); SuspendLayout(); iLibrary.Control.Dock = DockStyle.Fill; //iLibrary.Control.Height = Height - button1.Height - button2.Height; Controls.Clear(); Controls.Add(iLibrary.Control); Controls.Add(this.button2); Controls.Add(this.button1); ResumeLayout(false); iEventServer.Start(aApp.Interface); iSsdpListener.Start(aApp.Interface); iLibrary.Start(); iLibrary.Open(); }
public void Start(IPAddress aIpAddress) { iEventServer.Start(aIpAddress); iListenerNotify.Start(aIpAddress); iHouse.Start(aIpAddress); iHouse.Rescan(); }
private void Form1_Load(object sender, EventArgs e) { IPAddress addr = iHelper.Interface.Interface.Info.IPAddress; iEventServer.Start(addr); iListenerNotify.Start(addr); iModelLibrary.Start(addr); }
void IStack.Start(System.Net.IPAddress aIpAddress) { iEventServer = new EventServerUpnp(); iListenerNotify = new SsdpListenerMulticast(); iBoxes = new Boxes(iHelper, iEventServer, iListenerNotify); iBoxes.EventRoomAdded += RoomAddedHandler; iBoxes.EventRoomRemoved += RoomRemovedHandler; iEventServer.Start(aIpAddress); iListenerNotify.Start(aIpAddress); iBoxes.Start(aIpAddress); }
private void button2_Click(object sender, EventArgs e) { iLibrary.Close(); iLibrary.Stop(); iSsdpListener.Stop(); iEventServer.Stop(); iEventServer.Start(iApp.Interface); iSsdpListener.Start(iApp.Interface); iLibrary.Start(); iLibrary.Open(); }
public Finder(IPAddress aInterface, IConsole aConsole, string aUglyName) { iInterface = aInterface; iConsole = aConsole; iUglyName = aUglyName; iMutex = new Mutex(); iIsFound = new ManualResetEvent(false); iIsBootModeSet = new ManualResetEvent(false); iIsRebootAccepted = new ManualResetEvent(false); iIsByeByeReceived = new ManualResetEvent(false); iIsAliveReceived = new ManualResetEvent(false); iListener = new SsdpListenerMulticast(); iListener.Add(this); iListener.Start(iInterface); }
public Device Find(IPAddress aInterface, int aTimeout) // in milliseconds { Trace.WriteLine(Trace.kTopology, "DeviceFinder Find: " + iUglyName); iListener.Start(aInterface); iDeviceList.Start(aInterface); iSemaphore.WaitOne(aTimeout, false); Trace.WriteLine(Trace.kTopology, "DeviceFinder Found: " + iUglyName); iDeviceList.Stop(); iListener.Stop(); if (iFound) { return(iDevice); } throw (new DeviceFinderException()); }
void IStack.Start(IPAddress aIpAddress) { iListenerNotify.Start(aIpAddress); iDeviceListProduct.Start(aIpAddress); }