public void Dispose () { if (browser == null) return; browser.Dispose (); browser = null; }
private static void OnServiceTypeAdded (object o, ServiceTypeInfoArgs args) { Console.WriteLine ("Got service type: " + args.ServiceType.ServiceType); ServiceBrowser sb = new ServiceBrowser (client, args.ServiceType.ServiceType, args.ServiceType.Domain); objects.Add (sb); sb.ServiceAdded += OnServiceAdded; }
public void Browse(string regtype, string domain) { Dispose(); client = new AV.Client(); browser = new AV.ServiceBrowser(client, regtype, domain); browser.ServiceAdded += OnServiceAdded; browser.ServiceRemoved += OnServiceRemoved; }
public void Dispose() { if (client != null) { client.Dispose(); client = null; } if (browser != null) { browser.Dispose(); browser = null; } }
public void Dispose() { if(client != null) { client.Dispose(); client = null; } if(browser != null) { browser.Dispose(); browser = null; } }
public void Start () { browser = new ServiceBrowser (avahi_client, "_beagle._tcp"); browser.ServiceAdded += OnServiceAdded; browser.ServiceRemoved += OnServiceRemoved; }
public ICollection<NetworkService> GetServicesBlocking () { object sync_lock = new object (); lock (sync_lock) { browser = new ServiceBrowser (avahi_client, "_beagle._tcp"); browser.ServiceAdded += OnServiceAdded; browser.AllForNow += delegate (object o, EventArgs args) { Console.WriteLine ("All for now!"); lock (sync_lock) { Monitor.Pulse (sync_lock); } }; Monitor.Wait (sync_lock); Console.WriteLine ("Return!"); } return services; }
public void Start() { try { sb = new ServiceBrowser (client, "_ldap._tcp"); sb.ServiceAdded += OnServiceAdded; sb.ServiceRemoved += OnServiceRemoved; } catch (Exception e) { Log.Debug (e); } }