Пример #1
0
 public void Dispose()
 {
     if (browser != null)
     {
         browser.Dispose();
     }
 }
Пример #2
0
        public void  Stop()
        {
            if (reliableSocket != null)
            {
                reliableSocket.Dispose();
                reliableSocket = null;
            }

            if (slpUser != null)
            {
                slpUser.Dispose();
                slpUser = null;
            }

#if mDNS_Discovery
            if (dnsSD != null)
            {
                dnsSD.Dispose();
                dnsSD = null;
            }
#endif

            if (rdmNetSocket != null)
            {
                rdmNetSocket.Close();
                rdmNetSocket = null;
            }
        }
Пример #3
0
        public async void Stop()
        {
            if (mServer == null)
            {
                throw new InvalidOperationException();
            }
            timer.Change(Timeout.Infinite, Timeout.Infinite);
            var closeTask = mServer.CloseAsync();

            mServer = null;
            mConfig = null;
            try
            {
                serviceRegister.Dispose();
            }
            catch { }
            serviceRegister = null;
            try
            {
                sb.Dispose();
            }
            catch { }
            sb = null;
            await closeTask;

            lock (knownHosts) knownHosts.Clear();
        }
Пример #4
0
        public void Stop()
        {
            if (dnsSD != null)
            {
                dnsSD.Dispose();
                dnsSD = null;
            }

            if (slpUser != null)
            {
                slpUser.Close();
                slpUser = null;
            }

            if (acnSocket != null)
            {
                acnSocket.Close();
                acnSocket = null;
            }

            if (reliableSocket != null)
            {
                reliableSocket.Dispose();
                reliableSocket = null;
            }
        }
Пример #5
0
 public void Stop()
 {
     try {
         sb.Dispose();
     } catch (Exception e) {
         Log.Debug(e);
     }
 }
 public void Destroy()
 {
     foreach (var hw in createdInterfaces)
     {
         hw.Value.Destroy();
     }
     browser.Dispose();
 }
Пример #7
0
 public void Stop()
 {
     if (browser != null)
     {
         browser.Dispose();
         browser = null;
     }
     services.Clear();
 }
Пример #8
0
        public void Dispose()
        {
            if (browser == null)
            {
                return;
            }

            browser.Dispose();
            browser = null;
        }
Пример #9
0
 public void Stop()
 {
     if (browser != null)
     {
         lock (locker) {
             services.Clear();
         }
         browser.Dispose();
         browser = null;
     }
 }
    public static void Main()
    {
        Application.Init();

        // Register a sample service
        RegisterService service = new RegisterService("Fruity Music", null, "_daap._tcp");
        TxtRecord       record  = new TxtRecord();

        record.Add("A", "Apples");
        record.Add("B", "Bananas");
        record.Add("C", "Carrots");
        service.Port      = 8080;
        service.TxtRecord = record;
        service.RegisterAsync();

        // Listen for events of some service type
        ServiceBrowser browser = new ServiceBrowser("_daap._tcp");

        browser.ServiceAdded   += OnServiceAdded;
        browser.ServiceRemoved += OnServiceRemoved;
        browser.StartAsync();

        // Unregister our service in 10 seconds
        GLib.Timeout.Add(10000, delegate {
            service.Dispose();
            return(false);
        });

        // Stop browsing and quit in 15 seconds
        GLib.Timeout.Add(15000, delegate {
            browser.Dispose();
            Application.Quit();
            return(false);
        });

        Application.Run();
    }
Пример #11
0
 public void Stop()
 {
     browser.Dispose();
     browser = null;
     services.Clear();
 }